4 ms·
Ruff is not a replacement for black[^1]. It's also currently complementary to pylint, not a replacement[^2]. I still use those tools with ruff. Further, out of
by js2 3y ago
Ruff is not a replacement for black[^1]. It's also currently complementary to pylint, not a replacement[^2]. I still use those tools with ruff.
Further, out of the box, ruff doesn't even replace isort. You have to specifically enable it to sort imports (`I`)[^3].
I personally think that ruff's defaults are much too conservative. I configure it with `ALL` and then ignore the rules I don't want. I _want_ upgrades of ruff which add new rules to find new things. I'll never know about the new rules if I have to follow its development. I fully expect `pre-commit autoupdate` to cause me some pain after I run it, and that's okay. Linters adding new rules are usually helping me make my code cleaner.
[^1]: https://docs.astral.sh/ruff/faq/#is-ruff-compatible-with-black https://docs.astral.sh/ruff/faq/#is-ruff-compatible-with-bla...
[^2]: https://docs.astral.sh/ruff/faq/#how-does-ruff-compare-to-pylint https://docs.astral.sh/ruff/faq/#how-does-ruff-compare-to-py...
[^3]: https://docs.astral.sh/ruff/rules/#isort-i https://docs.astral.sh/ruff/rules/#isort-i
- cosmojg 3y agoWhat does your pyproject.toml (or equivalent) look like? Which linters, formatters, and similar tools do you consider essential to your Python development workflow?
- 0xFF0123 3y agoAlthough it's in alpha, Ruff does have a replacement for Black. https://github.com/astral-sh/ruff/blob/main/crates/ruff_python_formatter/README.md https://github.com/astral-sh/ruff/blob/main/crates/ruff_pyth...