-
-
Notifications
You must be signed in to change notification settings - Fork 74
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 Ruff D rule #982
base: enhancement/rx-docs
Are you sure you want to change the base?
Add Ruff D rule #982
Conversation
"D105", # Missing docstring in magic method" | ||
"D107", # Missing docstring in `__init__`" | ||
"D200", # One-line docstring should fit on one line" | ||
"D203", # one-blank-line-before-class and `no-blank-line-before-class` (D211) are incompatible. |
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'm proposing D211 over D203. What I care most about is that we have a rule enforcing consistency.
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.
Do you even need to pick one of them? D203 is disabled by default and D211 enabled by default for the numpy
convention. At least that's what the docs say https://docs.astral.sh/ruff/rules/blank-line-before-class/.
"D200", # One-line docstring should fit on one line" | ||
"D203", # one-blank-line-before-class and `no-blank-line-before-class` (D211) are incompatible. | ||
"D205", # 1 blank line required between summary line and description | ||
"D212", # multi-line-summary-first-line. Alternative is to ignore D213 `multi-line-summary-second-line`. |
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'm proposing D213 over D212. Again - I don't care so much about the specific rule as I care about having a rule and consistency.
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.
No opinion on this one.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #982 +/- ##
=======================================
Coverage 87.35% 87.36%
=======================================
Files 9 9
Lines 4935 4938 +3
=======================================
+ Hits 4311 4314 +3
Misses 624 624 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
Just changing base branch so it easier to review |
@@ -25,37 +25,37 @@ class Serialization: | |||
|
|||
@classmethod | |||
def schema(cls, pobj, subset=None): | |||
raise NotImplementedError # noqa: unimplemented method | |||
raise NotImplementedError |
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'm unsure why this has changed; maybe it's because of --unsafe-fixes
. I don't think they should be added back
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.
Ruff complained that specific rules like D123
should be used with noqa. So I removed them. Forgot to explain that.
@@ -138,6 +139,7 @@ async def async_wait_until(fn, timeout=5000, interval=100): | |||
Waiting interval, by default 100 | |||
|
|||
Adapted from pytest-qt. | |||
|
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 don't understand this empty line, as other docstrings do not necessarily have it. But if this is what ruff say, so be it.
"D105", # Missing docstring in magic method" | ||
"D107", # Missing docstring in `__init__`" | ||
"D200", # One-line docstring should fit on one line" | ||
"D203", # one-blank-line-before-class and `no-blank-line-before-class` (D211) are incompatible. |
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.
Do you even need to pick one of them? D203 is disabled by default and D211 enabled by default for the numpy
convention. At least that's what the docs say https://docs.astral.sh/ruff/rules/blank-line-before-class/.
"D200", # One-line docstring should fit on one line" | ||
"D203", # one-blank-line-before-class and `no-blank-line-before-class` (D211) are incompatible. | ||
"D205", # 1 blank line required between summary line and description | ||
"D212", # multi-line-summary-first-line. Alternative is to ignore D213 `multi-line-summary-second-line`. |
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.
No opinion on this one.
Builds on #977. So review that one first.
The only thing I've touched is in pyproject.toml. The rest is auto fixed by Ruff when I run
ruff check
.