-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Apply assorted ruff rules #13093
base: master
Are you sure you want to change the base?
Apply assorted ruff rules #13093
Conversation
ISC001 Implicitly concatenated string literals on one line
PYI018 Private TypeVar is never used
faf4168
to
2a1720e
Compare
@@ -92,7 +92,7 @@ def match(self, value: str | list | tuple) -> bool: | |||
|
|||
|
|||
class _Opt: | |||
__slots__ = 'default', 'rebuild', 'valid_types', 'description' | |||
__slots__ = 'default', 'description', 'rebuild', 'valid_types' |
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.
Why this change? The slots are in definition order
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.
This is indeed debatable. The rationale for RUF023 is:
Checks for
__slots__
definitions that are not ordered according to a natural sort.
Consistency is good. Use a common convention for this special variable to make your code more readable and idiomatic.
PRs which apply multiple rules at once make history harder to decipher, perhaps we could split to one PR per rule, or per group of rules. A |
Alternatively, merge without squashing. The PR is already split into multiple commits. |
PYI030 Multiple literal members in a union. Use a single literal, e.g. `Literal['a', 'b']`
RUF022 `__all__` is not sorted
RUF023 `__slots__` is not sorted
2a1720e
to
57f6416
Compare
Merge commits are disabled for this repo -- there's no option to select it. This is to preserve linear history. (I do appreciate the effort to split into individual commits, though, thank you) |
Subject: apply new ruff rules
Feature or Bugfix