-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce ruff (eventually replacing autoflake, pyupgrade, flake8) #86224
Conversation
Hey there @home-assistant/core, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
Hey there @home-assistant/core, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
Hey there @bdraco, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
Hey there @emontnemery, @jbouwh, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
Hey there @OttoWinter, @jesserockz, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
This comment was marked as outdated.
This comment was marked as outdated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright! Looks ready to go, can be merged once the CI passes.
Thanks @akx 👍
Let's see how it goes and re-evaluate the next steps after some experience has been gained.
../Frenck
Proposed change
This PR adds the extremely fast ruff linter to the pre-commit/lint pipeline; it will probably eventually replace autoflake, pyupgrade, and flake8.
This revision of the PR adheres to the Approach 2 discussed in home-assistant/architecture#863 (comment) aside from adding the VSCode tooling since the version that https://marketplace.visualstudio.com/items?itemName=charliermarsh.ruff ships with is not the same as in the hooks.
Performance
On 3f34871 (dev) it takes about 90 wall-clock seconds on my Macbook to run those tools on the whole repo:
Meanwhile,
ruff
(with the configuration in this PR), with a freshly cleaned cache, takes 8 seconds. Yes, it really is that fast.Nota bene
ruff
that hadn't been spotted by the previous linting tools. Exclusions could be peeled off if required, likely in follow-up PRs.pylint
,bandit
, andisort
rules, but those aren't enabled in this PR yet out of an abundance of caution due to the custom configuration in the repo.Type of change
Checklist
black --fast homeassistant tests
)requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
.