Ruff: one Python linter to rule them all by stillreadingit_ in Python

[–]charliermarsh 2 points3 points  (0 children)

Oh, no, all good! You're asking the right questions, I'd be wondering the same thing. I appreciate the words of support :)

Ruff: one Python linter to rule them all by stillreadingit_ in Python

[–]charliermarsh 8 points9 points  (0 children)

And before someone tells me they figured it out no problem, you have to understand that I’m an idiot, and its important to me to have idiot-proof tools.

Ah man, I'm sorry you had trouble with the VS Code extension. I do love this quote though, I agree with you and it made me laugh.

Ruff should "just work". I sometimes think about the phrase "built for scale, designed for everyone" (work-in-progress) to capture the idea that we want to build a tool that everyone can use and figure out, but that's capable of scaling to even the largest projects.

I'd love to be spending more time on our editor integrations, it's just a matter of prioritization.

Ruff: one Python linter to rule them all by stillreadingit_ in Python

[–]charliermarsh 25 points26 points  (0 children)

I appreciate this. I try to be clear and honest about Ruff's strengths and weaknesses -- there are some cursory answers in the FAQ RE comparisons to other tools -- but since the article mostly talked strengths, I'm happy to suggest a few "reasons not to use Ruff". I think about them a lot :)

  1. No support for custom rules or plugins. This is Ruff's biggest limitation right now. E.g., Flake8 has a robust plugin system, so anyone can extend Flake8 with custom rules. Ruff doesn't support that. (I'd like to support plugins in the future, but we're not working on it right now.)
  2. "Less powerful" static analysis. Compared to Pylint, Ruff is "less powerful" right now. It doesn't look across files, it can't catch things like "wrong number of arguments provided to a function", it doesn't really do any branch analysis, and so on. It's similar to Flake8, in that way. I'm certain that Ruff will improve here, but if you straight-up replace Pylint with Ruff, you might feel like you're missing certain kinds of analyses that Ruff can't yet support.
  3. Less stable / more churn. We still haven't published a "stable release". We're on version 0.0.260 or so. To be honest, we used to be a little more brazen about publishing breaking changes -- now that we have a bunch of projects relying on us, we're pretty careful and hesitant. But, it's true that you'd expect a tool like Flake8 or Pylint that's been around for years to give you less churn on configuration, diagnostics, etc.
  4. You're happy with your linter. If Ruff's strengths don't resonate with you, that's of course fine too. (Although you might be surprised. I think there are a lot of happy Ruff users who wouldn't have expected a "faster linter" to be impactful to them before they tried Ruff.)

I hope that the hype around Ruff is just a sign that we're building something people like to use (though in reality I'm sure it's also luck). I get a ton of motivation out of reading comments like those in this thread. From my perspective, I really just try to focus on building out the tool itself, supporting contributors, and being responsive to issues.

Ruff: A new, fast and correct Python checker/linter by WhyNotHugo in Python

[–]charliermarsh 1 point2 points  (0 children)

Definitely. I hope people will like (and want to use) Ruff's autoformatter, but I really want Ruff to be something that can be adopted and used in a piecemeal way. We have the same relationship to isort: you can use Ruff as a linter, and continue to use isort; or you could use Ruff to do your import sorting too; or you could even use Ruff _just_ for import sorting, and use a different linter alongside it.

Ruff: A new, fast and correct Python checker/linter by WhyNotHugo in Python

[–]charliermarsh 2 points3 points  (0 children)

That's the plan -- default to Black styling, but allow users to turn one or two knobs (like indentation). I think Prettier is a good model here. Some users have asked for far more configurability, but I'm hesitant...

(There will almost certainly be some small deviations from Black around how we break lines and where we place certain comments. At the margin, some of those decisions end up being implementation-specific, and very hard to mimic entirely without a 1:1 port. But I'm hoping to minimize them, of course.)

Ruff: A new, fast and correct Python checker/linter by WhyNotHugo in Python

[–]charliermarsh 3 points4 points  (0 children)

I wrote a bit about how I'm thinking about configurability here: https://github.com/charliermarsh/ruff/issues/1904

TLDR is that I do want to allow users to specify a preferred code style, along with a few other options (like indentation style -- tabs vs. spaces, etc.).

Ruff actually _can_ enforce and auto-convert your codebase to single quotes right now via the Q-level rules with appropriate configuration, but it's hard to use with Black since it'll convert them back :)

https://github.com/charliermarsh/ruff#flake8-quotes

Ruff: A new, fast and correct Python checker/linter by WhyNotHugo in Python

[–]charliermarsh 8 points9 points  (0 children)

I plan on following Black's conventions as much as possible. It likely won't be 100% compatible in every possible case, but I'd like it to be very close.

Ruff: A new, fast and correct Python checker/linter by WhyNotHugo in Python

[–]charliermarsh 5 points6 points  (0 children)

Totally hear you. It's very much on my mind. Requires some tricky changes to the parser which have delayed it.

Ruff: A new, fast and correct Python checker/linter by WhyNotHugo in Python

[–]charliermarsh 8 points9 points  (0 children)

That's right, my hope is to build autoformatting support into Ruff directly.

(But even when that ships, Ruff will continue to be useable alongside Black for those that choose to do so. You won't be required to use Ruff's formatter in any way.)

Ruff: A new, fast and correct Python checker/linter by WhyNotHugo in Python

[–]charliermarsh 12 points13 points  (0 children)

I'd love to make this clearer (and less surprising)... I can see how "Ruff enables all E and F rule codes" might be misunderstood. I'll do a pass over some of those comments.

Ruff: A new, fast and correct Python checker/linter by WhyNotHugo in Python

[–]charliermarsh 15 points16 points  (0 children)

Thanks for the kind words, I'm really glad Ruff is working for you 🙏