Skip to content
This repository has been archived by the owner on Mar 22, 2024. It is now read-only.

Introduce ruff #172

Open
neob91-close opened this issue Feb 1, 2023 · 6 comments
Open

Introduce ruff #172

neob91-close opened this issue Feb 1, 2023 · 6 comments
Labels
enhancement New feature or request

Comments

@neob91-close
Copy link
Contributor

neob91-close commented Feb 1, 2023

Ruff is a linter boasting extreme speed and near-parity with the flake8 ruleset.

While speed is important, I think its greatest benefit is the ability to automatically fix issues.
Not sure whether it could replace flake8, but if it doesn't conflict with it or black, it would be a great addition IMO.

@neob91-close neob91-close added the enhancement New feature or request label Feb 1, 2023
@neob91-close
Copy link
Contributor Author

CC @nsaje @tsx

@nsaje
Copy link

nsaje commented Feb 1, 2023

I would love a flake8 autofix functionality, I am a bit concerned with the maturity of ruff though - seems like it's quite new and under very active development.

How about considering https://github.com/PyCQA/autoflake ?

@AlecRosenbaum
Copy link
Contributor

TIL about ruff.

I'd be happy with anything that automatically fixes unused imports, though it seems like ruff is pretty widely used by rather mature projects. If it really is as fast as it claims, both its speed and ability to auto fix feels like a game changer.

@vtclose
Copy link
Contributor

vtclose commented Feb 2, 2023

It does look very interesting. I'm gonna test it out.

@vtclose
Copy link
Contributor

vtclose commented Feb 4, 2023

It does look very good indeed. It covers more or less everything we need from flake8 and it's instant. 0.5s without cache, 0.1s with cache on our main codebase. Ruff even covers like 90% of our isort, only being incompatible with a couple configuration options. I'm more than willing to give up the remainder for autofix + instant linting.

If we replace both isort and flake8 with ruff, the only other tools in our setup are black and mypy, and neither of those need the "--changed" functionality. And with just 3 tools, maintaining a separate umbrella package for linting tools is pretty much unnecessary, so we can get rid of lintlizard altogether.

Thoughts?

@neob91-close
Copy link
Contributor Author

Well, if we replaced flake8 and isort with ruff, then perhaps lintlizard might seem like overkill a little bit, but I don't think we should get rid of it just yet:

  • it is still nice to have a single command to run everything, with a summary of whether any of the tools failed (and which). Also, when we introduce Conceal output of tools that succeeded #149 at some point, it will become that much more convenient.
  • We were planning to move linter configurations to lintlizard so we could keep a consistent setup across our projects. I think lintlizard would still be a good place for that.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants