-
Notifications
You must be signed in to change notification settings - Fork 94
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
GitHub Action to lint Python code #1025
Conversation
[Ruff](https://beta.ruff.rs/) supports [over 500 lint rules](https://beta.ruff.rs/docs/rules) including bandit, isort, pylint, pyupgrade, and flake8 plus its plugins, and is written in Rust for speed. The `ruff` Action uses minimal steps to __run in ~5 seconds__, rapidly providing intuitive GitHub Annotations to contributors. ![image](https://user-images.githubusercontent.com/3709715/223758136-afc386d2-70aa-4eff-953a-2c2d82ceea23.png)
Thanks. I am not currently using a linter on osxphotos so will need to see how much noise ruff makes before I merge this. |
Please approve the |
Which rules are being ignored? Also, why did you use 7228 for line length? (I admit, I hate linters that enforce short line lengths. I'm old enough to have used an 80 character phosphorous CRT and I don't understand why modern linters want to continue to enforce that when we're using 4K+ monitors and modern text editors). |
I did not pick the number from thin air... I am sure that if we set it to 7227 and rerun the tests some super long line will raise an error. I am old enough to have used (in anger) 80-column punchcards so I merely set the line length at the limit of the codebase. That way if someone comes along and tries to create a new line that is 7229 chars long, they have to justify their excess in a code review. |
tests/test_catalina_10_15_7.py:1360:201: E501 Line too long (7228 > 200 characters) |
That line (7227 chars) and a couple other long ones are test data. Eventually I should add a # noqa to those and use a more reasonable (but still >> 79 chars) line length. |
@all-contributors please add @cclauss for code |
I've put up a pull request to add @cclauss! 🎉 |
Ruff supports over 500 lint rules and can be used to replace Flake8 (plus dozens of plugins), isort, pydocstyle, yesqa, eradicate, pyupgrade, and autoflake, all while executing (in Rust) tens or hundreds of times faster than any individual tool.
The
ruff
Action uses minimal steps to run in ~5 seconds, rapidly providing intuitive GitHub Annotations to contributors.