astral-sh / ruff

An extremely fast Python linter and code formatter, written in Rust.
https://docs.astral.sh/ruff
MIT License
33.12k stars 1.11k forks source link

Suggestion: Implement Sourcery rules #11060

Open diceroll123 opened 7 months ago

diceroll123 commented 7 months ago

Sourcery is a closed-source, paid program with refactoring/suggestion rules, some of which are covered by existing rules within Ruff.

Since Sourcery is closed-source, the rules would need to be clean room implementations.

Below, I've enumerated all current Sourcery rules with any overlap with Ruff 0.4.1, for Astral's consideration.

Note: There is of course the possibility that some unimplemented rules below are equivalent to different unimplemented rules from different libraries, such as Pylint.

I expect that any implementations made would fall under RUF (if there is no unimplemented alternative from another set of rules)?


MithicSpirit commented 7 months ago

Do we know what license the Sourcery documentation is distributed under? There might be legal issues with basing implementations on it if it is sufficiently restrictive. Although, it might be fine regardless due to Google v. Oracle. I am not a lawyer; this is not legal advice.

diceroll123 commented 7 months ago

Also not a lawyer, but my intention here is the (surprisingly not the software development methodology of) clean room design.

After all, this issue's a proposal, and I would say nobody has the copyright over an idea of a lint rule, especially if we can't see the source to replicate it.

In any case, I leave it up to the team to decide!

rogelho-junior-byx commented 3 weeks ago

Hello @diceroll123 is this list updated with Ruff 0.7.x new rules? Asking that just to know if we need to check, thanks

diceroll123 commented 3 weeks ago

@rogelho-junior-byx I have not once updated the list since making this issue, would like to hear back from Astral folks before anyone spends time on it tbh 🫠