pytest-dev / pytest-cov

Coverage plugin for pytest.
MIT License
1.76k stars 212 forks source link

pre-commit: Replace flake8, isort, and pyupgrade with ruff #584

Closed cclauss closed 1 year ago

cclauss commented 1 year ago

Ruff supports over ~400~ 500 lint rules including flake8, isort, pylint, and pyupgrade and is written in Rust for speed. Also added rules for pylint conventions and pylint errors.

Pierre-Sassoulas commented 1 year ago

Who can take the decision to drop python 3.6 ? It's been EOL for a long time at this point.

RonnyPfannschmidt commented 1 year ago

Yes we can

cclauss commented 1 year ago

567 drops py36

ionelmc commented 1 year ago

Ruff looks nice if it can replace the all the tools with a single config. Are there any downsides with ruff or anything that would need attention?

cclauss commented 1 year ago

I have not seen downsides (except maybe it is not yet v1.0) and I have been using it broadly: https://beta.ruff.rs/docs/#testimonials

ionelmc commented 1 year ago

I've played a bit with ruff now, its isort support is incomplete (no support for default-section or src-paths at least). The old isort hook needs to be kept.

cclauss commented 1 year ago

This cannot be achieved by using forced separate, known parties, known local folder and src?

If not then I can drop the I rules from this pull request and bring back isort.

Timothy Crosley, creator of isort:

Just switched my first project to Ruff. Only one downside so far: it's so fast I couldn't believe it was working till I intentionally introduced some errors.

cclauss commented 1 year ago

As the Ruff docs say, select=ALL is a bad idea. Closing.

levrik commented 6 months ago

@ionelmc Ruff supports default-section nowadays btw after I opened an issue on their repo. It also includes a formatter now which can be used instead of Black. The nice thing here is that you do not have to ensure Black and linting rules are compatible as Ruff already takes care of this.