Replace flake8 and pycodestyle with ruff#131
Conversation
|
This is actually nice. The difference in speed is noticeable. |
|
Thank you for this PR!
|
Disabling line length checks (and code complexity checks) is a bad idea because it encourages further bad behavior. If instead we set an upper limit then if someone wants to contribute longer lines (or more complex code) then they need to justify in their pull request why they need messier code then is already in the codebase.
Rome was not built it a day. A pull request that improves the codebase by setting up guardrails moves the project forward. Fixing the two ignored issues will make for a much more complicated pull request to get reviewed and merged. Given that this pull request has taken more than 5 months to get reviewed, keeping the changes simple is goodness.
This GitHub Action does not use |
|
Contributors/Collaborators - Please feel free to approve and merge. One question: Do we need to ensure 'ruff' is installed on all systems without it being in the requirements.txt |
Perhaps ruff and black and similar tools should be run in pre-commit to ensure the same versions are installed on all contributing and testing machines. |
My bad, I did not mean the ignored issues, but it was a misunderstanding coming 100% from me. My working tree was dirty, and the command caught some errors in some experimental test files I had around. No real issues here.
Regardless of the misunderstanding, I believe the time it takes to review PRs here depends more on the availability of the maintainers than on anything else.
I would add a line to the dev.requirements.txt, with a specific version, and I think this PR would benefit from locking on the version of ruff in the workflow file too. RE: the line length check. I'm all for it and this could then be the last time two humans have a conversation about such a boring topic on this repo 🥂 . |
|
@jdevera, I merged this in, but CI wasn't happy with it, and I didn't have time to investigate. I've reverted it for now. I believe adding feat/* and bug/* to the GitHub action would be beneficial. This way, any push to such a branch would trigger CI, allowing us to know if CI fails before any PR is created. Had these changes been in feat/flake-ruff, a GitHub action would have been triggered. |
Ruff supports over 500 lint rules including bandit, flake8, isort, pylint, and pyupgrade and is written in Rust for speed.
Also added rules for pylint conventions, pylint errors, and pylint warnings.