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
Add linting via ruff
#1059
base: main
Are you sure you want to change the base?
Add linting via ruff
#1059
Conversation
Because Ruff uses 0.0.* versioning at the moment, I am using the `~` version specifier instead of `^`.
Currently I am only checking `hvac`, though we should probably check `tests` as well. Also, at some point we will probably want to drop flake8, but for now I will leave it as is.
Codecov Report
@@ Coverage Diff @@
## main #1059 +/- ##
==========================================
- Coverage 85.02% 84.84% -0.19%
==========================================
Files 65 65
Lines 3139 3095 -44
==========================================
- Hits 2669 2626 -43
+ Misses 470 469 -1
|
Hello again @dosisod ! First I want to say thanks for the detailed explanation, and especially for splitting the changes per-rule into discrete commits, that's exactly how I would've liked to see that 🤩 Some of the changes it made look really nice and are definitely ones I agree with, some of the others, I'm a little less sure about or don't understand. I am going to leave this open but I will have to deprioritize this change a little bit until I can give it more thought (especially per-rule) and try to discuss with the other maintainers. I definitely intend to re-evaluate it, but likely at some point post- |
Ruff is a really great flake8 alternative that includes a very comprehensive set of linter rules. This PR doesn't remove flake8, but since Ruff is meant to be a replacement of flake8 (and implements a superset of the same rules, click here for a full list), we could drop flake8 entirely.
I've configured Ruff to enable all available linter rules, and manually disabled all the ones that don't apply or are too noisy. Since Ruff is actively under development, any new lint rules are likely to be overlooked. By enabling them all (and fixing any errors), it is much easier to keep the codebase up to date.
Each commit is broken down to a single lint rule, or a group of similar lint rules. Feel free to yay or nay the commits you do or don't like, I can easily rebase accordingly.
Probably closes #874 as this PR converts
format()
calls to fstrings.