-
Notifications
You must be signed in to change notification settings - Fork 387
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
Use ruff for linting (instead of current flake8/isort/pyflakes) #727
Conversation
0e252b0
to
df3997c
Compare
Codecov Report
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. @@ Coverage Diff @@
## master #727 +/- ##
==========================================
+ Coverage 90.59% 90.64% +0.05%
==========================================
Files 28 28
Lines 1797 1796 -1
Branches 270 323 +53
==========================================
Hits 1628 1628
+ Misses 134 133 -1
Partials 35 35
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
b309801
to
9a55b68
Compare
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.
Hi @jairhenrique I am wondering:
- whether ruff should be replacing flake8 (rather than adding to it, the two living side by side) when https://beta.ruff.rs/docs/faq/#how-does-ruff-compare-to-flake8 says that only a "subset of the E and W rules (which originate from pycodestyle)" are implemented
- whether it's a gain or a loss to drop the
noqa
markers, in particular those with a number.
What do you think?
@hartwork I will enable default linters |
I usually don't use the numbers, I can't tell if this is a loss or gain. |
@jairhenrique what the numbers allow in theory is to annotate why something was marked noqa semantically (i.e. documentation) but also to limit the scope of the noqa marker to just that aspect so that the QA tool won't silence unrelated issues now or in the future by accident. I wonder, if we drop the markers, why doesn't ruff complain about the related cases, why doesn't ruff ask for the same issues to be intended and/or tolerable? |
@hartwork The ruff dropped |
@hartwork I returned the numbers in |
line-length = 110 | ||
target-version = "py38" | ||
|
||
[tool.ruff.isort] |
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.
I wonder what to do about the existing block tool.isort
further up:
[tool.isort]
line_length = 110
known_first_party = "vcrpy"
multi_line_output = 3
use_parentheses = true
include_trailing_comma = true
In particular:
- does ruff read any of that? (assuming: no)
- should it be dropped? (assuming: yes)
- can any of these options ported to ruff more?
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.
does ruff read any of that?
No 😄
should it be dropped?
Yes, done!
can any of these options ported to ruff more?
That's the default ruff configuration, but some settings configurations was not provided yet.
09eb037
to
446642f
Compare
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.
@jairhenrique thanks for the adjustments! I have checked locally that flake8 does not report any errors against the latest state (except the now expected "E501 line too long" because flake8 no longer knows we want 110 columns). The Python changes are great and if for some reason ruff should turn out to have serious drawbacks over flake8/isort/pyflakes latter, nothing is blocking a cheap return to these tools, so the risk is minimal. Good work! 👍
https://github.com/astral-sh/ruff