-
Notifications
You must be signed in to change notification settings - Fork 101
style: Enforce RUF010 and RUF015 rules
#2091
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
Conversation
Comment contains ambiguous ` ` (NO-BREAK SPACE). Did you mean ` ` (SPACE)?
Use explicit conversion flag
6d64af4 to
2091e4f
Compare
Prefer `next(iter())` over single element slice
Unused `noqa` directive
2091e4f to
f88d097
Compare
|
I think you have spotted good points:
Please add the related rules to ruff to enforce it. |
sphinx/conf.py
Outdated
| from github_link import make_linkcode_resolve # noqa | ||
| from matplotlib_skore_scraper import matplotlib_skore_scraper # noqa | ||
| from github_link import make_linkcode_resolve | ||
| from matplotlib_skore_scraper import matplotlib_skore_scraper |
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 directory is actually not covered by .pre-commit.
Please revert, otherwise i think we will have red IDE with some alerts on non-top imports.
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 ran ruff manually instead of pre-commit.
By the way, which tool does your IDE use to lint and raise such alerts? I think the relevant ruff alert would be E402 from pycodestyle, but the IDE might run a different linter.
|
By the way, I think you want Lines 149 to 150 in 2eefa98
Unless you also want |
This partielly reverts commit f88d097.
RUF010 and RUF015 rules
thomass-dev
left a comment
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.
Nice! I think we have enough rules for our code-style. Thanks.
We want all rules prefixed by |
|
So that would be rule sets |
Enforce RUF010 and RUF015 rules to standardize the code base.