-
Notifications
You must be signed in to change notification settings - Fork 2k
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
automation of linting test using pre-commit #11205
Comments
Another benefit is pinning the lint tools, so you don't get hit by sudden failures when linters release with add new checks. |
Yeah, I noticed that ruff is unpinned and will install whatever the latest version is. That's going to cause a lot of errors with how often ruff has a release with new features. There's over 100 lint failures on master right now. |
I started to work on it with the combo: black/prettier/ruff and it works quite ok. |
As a first step I suggest pinning to the linter versions that last passed, to get the infrastructure in place. Then we can update the versions and fix new warnings in a controlled manner in followups. |
Is there a "best practice" for doing this? I wasn't sure if it is just setting a reminder or maybe a cron job that runs the latest version so you can monitor the number of new warnings and fix them before they get out of hand. |
You can but do you really want to ? |
I use https://pre-commit.ci - it autofixes PRs, and sends autoupdate PRs every month (by default, but I set it to quarterly with this at the end of ci:
autoupdate_schedule: quarterly Also doesn't stop me running |
I'll go step by step as all the linting operation will crash. step one black + pre-commit + github actions |
I was working on a PR and I was surprised to see many linting errors.
I didn't see any documentation on which test I should run from my side (ruff, flak8 isort others).
Describe the solution you'd like
Use pre-commits to run all these linting checks automatically and use the same pre-commits in the github tests for consistency
The text was updated successfully, but these errors were encountered: