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

ruff check --preview --select=E303 #23155

Merged
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,8 @@ jobs:
- checkout
- pip-install
- run: ruff check
# TODO (cclauss): When ruff supports rule E303 without --preview, remove following line
- run: ruff check --preview --select=E303
Copy link
Collaborator

@sbc100 sbc100 Dec 13, 2024

Choose a reason for hiding this comment

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

Is there any way to have ruff check include E303 without adding these extra command line argument?

I'm just thinking for local development its nice to just run ruff check from time to time.

Copy link
Contributor Author

@cclauss cclauss Dec 13, 2024

Choose a reason for hiding this comment

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

Nope. We need to target using both --preview and --select=E303. Without --preview, E303 will not be tested. Without --select=E303 then ruff check --preview with our current ruff config in pyproject.toml returns:

Found 17355 errors.
[*] 497 fixable with the --fix option (221 hidden fixes can be enabled with the --unsafe-fixes option).

I chose this approach because running both commands one after the other will take a small fraction of one second.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ok that sounds like a reasonable solution for now. Can you add a comment explaining why this is needed? Is it simply that the ruff authors are still working on the E303 rule? Will it become stable at some point and we can remove this? Perhaps mention that in the comment?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

mypy:
executor: bionic
steps:
Expand Down
3 changes: 0 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,8 @@ lint.ignore = [
"PLW1510",
"PLW2901",
]

lint.per-file-ignores."emrun.py" = [ "PLE0704" ]

lint.mccabe.max-complexity = 48 # Recommended: 10

lint.pylint.allow-magic-value-types = [
"bytes",
"float",
Expand Down
Loading