I love Ruff. It's amazing. It's blindingly fast. I dig it.
But. v0.1.0 comes with a breaking change: the old `--output` option is now named `--output-format`, and it was only deprecated 3 weeks ago in version 0.0.291 (https://github.com/astral-sh/ruff/releases/tag/v0.0.291). That's bound to break some CI pipelines, and definitely breaks the python-lsp-ruff language server plugin. If you use the latter, I have a PR at https://github.com/python-lsp/python-lsp-ruff/pull/48 that will get you running again for now.
To be super clear, the Ruff team doesn't owe it to anyone to make the command line stable. This is a little inconvenient, but that's our problem, not theirs. They've made an amazing free tool we can all use. Still, it's something you'll need to know about and deal with.
Edit: “our” as in “us end users”. I’m also just an end user of python-lsp-ruff and not associated with it. I realized on re-reading that it might sound like I’m one of its developers. Nope!
This announcement post specifically addresses this: v0.1.0 introduces a new versioning policy [0], where patch versions (v0.1.1) are guaranteed to no longer break "stable" features, while minor versions (v0.2.0) can. At some point I'd assume they plan on stabilizing it such that even minor versions don't break stable features, but as a sibling notes, using v0 as a project's major version is usually intended to communicate that you shouldn't count on things staying stable.
If they're using semver, having a major version number of zero means that any change can be breaking. Additionally, while it's not part of the semver spec, to me having the minor version be zero as well is an even bigger indicator that nothing is stable.
I read this comment on the train to work today. First thing that happened at work was that somebody had disabled the linting stage because of exactly this error.
> We also released an alpha version of our Black-compatible code formatter.
Interesting that Ruff has replaced so many linters, and now going for formatter next. One tool to rule them all!
Extra interesting that Ruff appears to provide more knobs than Black, which will likely be a big plus for those not happy with how opinionated Black is.
For teams, I'm not sure the knobs are a good thing. Sounds like it will just be another source of infinite bikeshedding arguments. I am a big fan of "set up Black and forget about it", even if I dislike some things it does (like the space after the colon in one-sided slices).
I was an early adopter of Ruff, what sold me wasn't even the performance win, but the advantage of having a single configuration file without third-party plugins, making it much easier to run the linter in my editor, CLI, pre-commit hooks, and CI without any fuss.
The speed of the tool and its development pace astound me.
If the authors/maintainers are lurking here: know that you're doing an amazing job.
I'll be ecstatic when the inevitable rust-backed python typechecker arrives, python type checking has been excruciatingly slow in the various places I've used it. Ruff is a great start though!
Have you seen Pyre[0]? Not Rust, OCaml, and pretty fast. Made by a team at Meta and open sourced on GitHub. If you use python-lsp, I wrote an extension[1] to enable integration (though I haven't tested it recently, been programming in rust; it is mostly a "for me" extension).
One suggestion to the authors - every serious codebase I've ever worked on had their own set of linters and plugins for whatever linter they were using.
How do I extend Ruff? Can I extend Ruff? How do I write plugins and linters? It's Rust in Python and I am generally leery of such things. The fact that it's one tool to do all these things makes believe it's because the tool is inflexible so it must be able to do all these things.
I'm impressed by Ruff. I heard about it a while ago and just assumed I wouldn't be able to use it because it's not just flake8 I like, but a bunch of third-party flake8-* plugin packages too.
> In the future, we’ll build and sell services on top of our tools — but the tools themselves will remain free and open-source.
> Our plan is to provide paid services that are better and easier to use than the alternatives by integrating our open-source offerings directly. Our goal is for these services to be as impactful as Ruff itself — but you may choose not to use them. Either way, Ruff will remain free and open-source, just as it is today.
This is also my question. I think ruff is a great tool. I love it and use it on all my new projects. It is an insanely fast and enjoyable tool in a Python world where tools are frequently very slow and a pain to use. But how are you going to make money as a linting tool?
I will say that seeing from afar Charlie has been hiring some very smart people. Not sure how it will turn out but hopefully something good will come of it.
Looks very cool, but I don't feel like I've had many problems with tool speed. Is this actually better than all of those listed tools in terms of features? I feel like I might just end up using all of them.
The speed difference sneaks up on you - Ruff is so fast there’s usually no perceptible delay but then you use flake8 + isort + pyupgrade and you realize how much you’d gotten used to the minor but noticeable delays.
For me, the big win is having a single tool instead of a dozen - like when the last flake8 update happened we had to play plug-in Jenga until everything updated, you have different configuration files for flake8, isort, pyupgrade, pylint, bandit, etc. and inconsistent support for pyproject.toml or ignoring things, etc. None of that is a big problem but it’s nice for it just to be gone entirely.
Ruff isn't quite at feature priority with the tools it's replacing (although it's close). The main benefits to using ruff is that it's great enough to run regularly locally without being noticable, even on large codebases and it provides tool chain consolidation (although the latter can be achieved with other tools like pants). The speed difference is more noticable in monorepos. If you instead have many smaller repos it probably makes sense to just implement the original tools
I’ve been meaning to find time to get ruff-lap working on Doom Emacs side by side with pyright. Is anyone who’s already managed to get it working willing to share their config?
For those who don’t know what Ruff is (like me, 5 minutes ago), here’s what the GitHub project describes it as:
> An extremely fast Python linter, written in Rust.
Pro-tip to announcement authors: it’s helpful when there’s a one-sentence description of the project at the top of a post/article for newcomers who aren’t familiar with the project.
[+] [-] kstrauser|2 years ago|reply
But. v0.1.0 comes with a breaking change: the old `--output` option is now named `--output-format`, and it was only deprecated 3 weeks ago in version 0.0.291 (https://github.com/astral-sh/ruff/releases/tag/v0.0.291). That's bound to break some CI pipelines, and definitely breaks the python-lsp-ruff language server plugin. If you use the latter, I have a PR at https://github.com/python-lsp/python-lsp-ruff/pull/48 that will get you running again for now.
To be super clear, the Ruff team doesn't owe it to anyone to make the command line stable. This is a little inconvenient, but that's our problem, not theirs. They've made an amazing free tool we can all use. Still, it's something you'll need to know about and deal with.
Edit: “our” as in “us end users”. I’m also just an end user of python-lsp-ruff and not associated with it. I realized on re-reading that it might sound like I’m one of its developers. Nope!
[+] [-] lolinder|2 years ago|reply
[0] https://astral.sh/blog/ruff-v0.1.0#ruffs-versioning-policy
[+] [-] Hasnep|2 years ago|reply
[+] [-] JulianWasTaken|2 years ago|reply
[+] [-] FredrikMeyer|2 years ago|reply
(of course I should have pinned versions...)
[+] [-] mdellavo|2 years ago|reply
[+] [-] ehsankia|2 years ago|reply
Interesting that Ruff has replaced so many linters, and now going for formatter next. One tool to rule them all!
Extra interesting that Ruff appears to provide more knobs than Black, which will likely be a big plus for those not happy with how opinionated Black is.
[+] [-] abenga|2 years ago|reply
[+] [-] samdg|2 years ago|reply
The speed of the tool and its development pace astound me.
If the authors/maintainers are lurking here: know that you're doing an amazing job.
[+] [-] nmca|2 years ago|reply
[+] [-] cricalix|2 years ago|reply
0: https://pyre-check.org/
1: https://github.com/cricalix/python-lsp-pyre
[+] [-] hkmaxpro|2 years ago|reply
Not sure how good it is.
[+] [-] diarrhea|2 years ago|reply
[+] [-] mdellavo|2 years ago|reply
How do I extend Ruff? Can I extend Ruff? How do I write plugins and linters? It's Rust in Python and I am generally leery of such things. The fact that it's one tool to do all these things makes believe it's because the tool is inflexible so it must be able to do all these things.
[+] [-] heavyset_go|2 years ago|reply
I think the philosophy right now is to treat it like Black, but I'm not going to speak for the authors or maintainers, it's just my opinion.
[+] [-] frou_dh|2 years ago|reply
Turns out Ruff went and reimplemented the majority of those I use, from scratch. https://docs.astral.sh/ruff/faq/#how-does-ruff-compare-to-fl...
[+] [-] feydaykyn|2 years ago|reply
[+] [-] throwawake|2 years ago|reply
> In the future, we’ll build and sell services on top of our tools — but the tools themselves will remain free and open-source.
> Our plan is to provide paid services that are better and easier to use than the alternatives by integrating our open-source offerings directly. Our goal is for these services to be as impactful as Ruff itself — but you may choose not to use them. Either way, Ruff will remain free and open-source, just as it is today.
It's there in their announcement post.
https://astral.sh/blog/announcing-astral-the-company-behind-...
[+] [-] SOLAR_FIELDS|2 years ago|reply
I will say that seeing from afar Charlie has been hiring some very smart people. Not sure how it will turn out but hopefully something good will come of it.
[+] [-] zeroCalories|2 years ago|reply
[+] [-] jxi|2 years ago|reply
[+] [-] acdha|2 years ago|reply
For me, the big win is having a single tool instead of a dozen - like when the last flake8 update happened we had to play plug-in Jenga until everything updated, you have different configuration files for flake8, isort, pyupgrade, pylint, bandit, etc. and inconsistent support for pyproject.toml or ignoring things, etc. None of that is a big problem but it’s nice for it just to be gone entirely.
[+] [-] twunde|2 years ago|reply
[+] [-] erikcw|2 years ago|reply
[+] [-] LarsDu88|2 years ago|reply
[+] [-] qup|2 years ago|reply
[+] [-] ShadowBanThis01|2 years ago|reply
[+] [-] cornstalks|2 years ago|reply
> An extremely fast Python linter, written in Rust.
Pro-tip to announcement authors: it’s helpful when there’s a one-sentence description of the project at the top of a post/article for newcomers who aren’t familiar with the project.
[+] [-] zanie|2 years ago|reply
[+] [-] unknown|2 years ago|reply
[deleted]