4 ms·
Ruff is an excellent base linter because it takes care of essential stuff and has sane default while integrates well without much work. It's not going to repla
by BiteCode_dev 3y ago
Ruff is an excellent base linter because it takes care of essential stuff and has sane default while integrates well without much work.
It's not going to replace pylint, but pylint is hard to configure and slow.
There is overlap between ruff checks and what's eliminated by black though, since ruff implemented flake8 rules first and a lot of them are PEP8 oriented.
Also, note that ruff is also a fast import sorter, faster than isort. But it's not a 1:1 match to isort (no fly to top, some formatting are different).
All in all, I would advice to use it if you are not used to linters, or if you don't feel like going full bazooka on a project.
It's has a very good cost/benefit ratio give how lighweight and easy to use it is.
- deleted 3y ago[deleted]
- iwebdevfromhome 3y agointeresting! I just set it up for a new project but I didn't know it had the ability to sort imports, how to you run this command ?
- claytonjy 3y agoEnable the "I" category and run ruff with autofixing.
- anderskaseorg 3y agoRuff actually focuses on checks that don’t overlap with Black. (“By default, Ruff enables Flake8's E and F rules. Ruff supports all rules from the F category, and a subset of the E category, omitting those stylistic rules made obsolete by the use of an autoformatter, like Black.”) Its import sorting is designed to be compatible with isort --profile=black by default (https://beta.ruff.rs/docs/faq/#how-does-ruffs-import-sorting-compare-to-isort https://beta.ruff.rs/docs/faq/#how-does-ruffs-import-sorting...). Many isort settings are supported (https://beta.ruff.rs/docs/settings/#isort https://beta.ruff.rs/docs/settings/#isort). I’m not sure what “fly to top” means.
- jstx1 3y agoWhy not replace pylint with it?
- claytonjy 3y agoPylint has hundreds of rules that ruff doesn't have, yet; see this GitHub issue: https://github.com/charliermarsh/ruff/issues/689 https://github.com/charliermarsh/ruff/issues/689