-
Notifications
You must be signed in to change notification settings - Fork 12
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 Python static analysis and formatting #1784
Conversation
d24f7e7
to
aa27031
Compare
] | ||
"**/migrations/**" = [ | ||
"N806", # Variable in function should be lowercase | ||
"RUF012", # Mutable class attributes should be annotated with `typing.ClassVar` |
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.
Could be removed after upstream fix?
"RUF012", # Mutable class attributes should be annotated with `typing.ClassVar` | ||
] | ||
"**/management/commands/**" = [ | ||
"INP001", # File is part of an implicit namespace package |
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.
Maybe require this to be importable, so commands can be overridden.
|
||
[tool.ruff.format] | ||
quote-style = "single" | ||
|
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.
@@ -14,7 +14,7 @@ class PublishConfig(AppConfig): | |||
verbose_name = 'DANDI: Publish' | |||
|
|||
@staticmethod | |||
def _get_sentry_performance_sample_rate(*args, **kwargs) -> float: | |||
def _get_sentry_performance_sample_rate(*args, **kwargs) -> float: # noqa: ARG004 |
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.
Maybe ignore overall.
|
||
# Try to fix upstream | ||
"RUF012", # Mutable class attributes should be annotated with `typing.ClassVar` | ||
] |
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.
] | |
"PTH119", # TODO: re-enable this when it's fixed | |
] |
@brianhelba we discussed this yesterday, and decided that a somewhat significant change like #1782 would be better to decouple from the Ruff work. Do you have any objections to just temporarily ignoring this rule so we can merge this PR?
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.
Added in 7122589
This replaces the entire Flake8 / isort / Black toolchain, while adding many new checks and improving performance.
🚀 PR was released in |
This replaces the entire Flake8 / isort / Black toolchain, while adding many new checks and improving performance.
These must be merged first, for tests here to pass:
assert
detected #1783