Skip to content
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

Adding ruff rule RUF #4235

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ select = [
"PLC", # pylint convention
"PLE", # pylint error
"Q", # flake8-quotes
"A", # flake8-builtins
"B", # flake8-bugbear
"N", # pep8-naming
"RUF", # Ruff-specific rules
Comment on lines +34 to +37
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this is following the pattern above, but can we add the links instead?

Suggested change
"A", # flake8-builtins
"B", # flake8-bugbear
"N", # pep8-naming
"RUF", # Ruff-specific rules
"A", # https://docs.astral.sh/ruff/rules/#flake8-builtins-a
"B", # https://docs.astral.sh/ruff/rules/#flake8-bugbear-b
"N", # https://docs.astral.sh/ruff/rules/#pep8-naming-n
"RUF", # https://docs.astral.sh/ruff/rules/#ruff-specific-rules-ruf

It really makes the review/understanding on the rules while developing faster to just click the link.

That said... Are those rules just running on pre-commit? Or the changes on the files are not applied yet?

In any case... I think all those rules are pedantic. Maybe instead of randomly getting rules from the list, checking some known projects, and which rules they use?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment is not necessarily for this PR, it's just about the setup itself.

]

ignore = [
Expand Down