-
Notifications
You must be signed in to change notification settings - Fork 1.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
Remove build
from the default exclusion list
#10093
Conversation
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.
Do you remember the motiviation for including build
in the exclude by default?
Nit: Extend your PR summary with an example on how to change the configuration when upgrading ruff for people that rely on build
being excluded.
Doesn't setuptools use that directory for building extension modules? |
And sometimes, it seems bdist_wheel copies the project's actual Python files to the build/ directory. In those cases, including that directory would cause the project to be linted twice. |
It's fine if some users need to ignore |
a145ab3
to
26477fb
Compare
|
code | total | + violation | - violation | + fix | - fix |
---|---|---|---|---|---|
I001 | 9 | 9 | 0 | 0 | 0 |
F401 | 8 | 8 | 0 | 0 | 0 |
PLR2004 | 4 | 4 | 0 | 0 | 0 |
E741 | 3 | 3 | 0 | 0 | 0 |
UP032 | 2 | 2 | 0 | 0 | 0 |
Linter (preview)
ℹ️ ecosystem check detected linter changes. (+45 -0 violations, +0 -0 fixes in 2 projects; 41 projects unchanged)
aws/aws-sam-cli (+41 -0 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview
+ samcli/commands/build/build_context.py:53:1: PLR0904 Too many public methods (26 > 20) + samcli/commands/build/build_context.py:54:9: PLR0917 Too many positional arguments (26/5) + samcli/commands/build/build_context.py:581:46: E741 Ambiguous variable name: `l` + samcli/commands/build/build_context.py:5:1: I001 [*] Import block is un-sorted or un-formatted + samcli/commands/build/build_context.py:610:21: E741 Ambiguous variable name: `l` + samcli/commands/build/build_context.py:642:46: E741 Ambiguous variable name: `l` + samcli/commands/build/command.py:139:5: PLR0917 Too many positional arguments (25/5) + samcli/commands/build/command.py:200:5: PLR0917 Too many positional arguments (22/5) + samcli/commands/build/command.py:228:5: PLC0415 `import` should be at the top-level of a file + samcli/commands/build/command.py:25:5: F401 [*] `samcli.commands._utils.options.terraform_plan_file_option` imported but unused + samcli/commands/build/command.py:5:1: I001 [*] Import block is un-sorted or un-formatted + samcli/commands/build/core/options.py:5:1: I001 [*] Import block is un-sorted or un-formatted + samcli/lib/build/app_builder.py:1003:28: PLR2004 Magic value used in comparison, consider replacing `-32601` with a constant variable + samcli/lib/build/app_builder.py:458:9: PLR0917 Too many positional arguments (10/5) + samcli/lib/build/app_builder.py:45:44: F401 [*] `samcli.local.docker.exceptions.ContainerNotStartableException` imported but unused + samcli/lib/build/app_builder.py:593:9: PLR0917 Too many positional arguments (11/5) + samcli/lib/build/app_builder.py:5:1: I001 [*] Import block is un-sorted or un-formatted + samcli/lib/build/app_builder.py:732:9: PLR0917 Too many positional arguments (8/5) ... 7 additional changes omitted for rule PLR0917 + samcli/lib/build/app_builder.py:991:16: PLR2004 Magic value used in comparison, consider replacing `400` with a constant variable + samcli/lib/build/app_builder.py:991:34: PLR2004 Magic value used in comparison, consider replacing `500` with a constant variable + samcli/lib/build/app_builder.py:995:28: PLR2004 Magic value used in comparison, consider replacing `505` with a constant variable + samcli/lib/build/build_graph.py:379:13: PLW1514 `open` in text mode without explicit `encoding` argument + samcli/lib/build/build_graph.py:471:13: PLW1514 `open` in text mode without explicit `encoding` argument + samcli/lib/build/build_graph.py:515:7: PLW1641 Object does not implement `__hash__` method + samcli/lib/build/build_graph.py:579:7: PLW1641 Object does not implement `__hash__` method + samcli/lib/build/build_graph.py:5:1: I001 [*] Import block is un-sorted or un-formatted + samcli/lib/build/build_strategy.py:30:51: F401 [*] `samcli.lib.utils.architecture.ARM64` imported but unused + samcli/lib/build/build_strategy.py:5:1: I001 [*] Import block is un-sorted or un-formatted ... 4 additional changes omitted for rule I001 + samcli/lib/build/bundler.py:10:50: F401 [*] `samcli.commands.local.lib.exceptions.InvalidHandlerPathError` imported but unused + samcli/lib/build/bundler.py:7:27: F401 [*] `pathlib.PosixPath` imported but unused + samcli/lib/build/utils.py:17:28: PLR6201 Use a `set` literal when testing for membership + samcli/lib/build/workflow_config.py:7:42: F401 [*] `typing.Tuple` imported but unused ... 1 additional changes omitted for rule F401
pypa/pip (+4 -0 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview
+ src/pip/_internal/operations/build/build_tracker.py:6:47: F401 [*] `typing.Set` imported but unused + src/pip/_internal/operations/build/build_tracker.py:8:39: F401 [*] `pip._internal.models.link.Link` imported but unused + src/pip/_internal/operations/build/wheel_legacy.py:43:15: UP032 [*] Use f-string instead of `format` call + src/pip/_internal/operations/build/wheel_legacy.py:49:15: UP032 [*] Use f-string instead of `format` call
Changes by rule (11 rules affected)
code | total | + violation | - violation | + fix | - fix |
---|---|---|---|---|---|
PLR0917 | 12 | 12 | 0 | 0 | 0 |
I001 | 9 | 9 | 0 | 0 | 0 |
F401 | 8 | 8 | 0 | 0 | 0 |
PLR2004 | 4 | 4 | 0 | 0 | 0 |
E741 | 3 | 3 | 0 | 0 | 0 |
PLW1514 | 2 | 2 | 0 | 0 | 0 |
PLW1641 | 2 | 2 | 0 | 0 | 0 |
UP032 | 2 | 2 | 0 | 0 | 0 |
PLR0904 | 1 | 1 | 0 | 0 | 0 |
PLC0415 | 1 | 1 | 0 | 0 | 0 |
PLR6201 | 1 | 1 | 0 | 0 | 0 |
We need to remove |
@MichaReiser - I'll do it now and merge this. |
26477fb
to
c2f7d3c
Compare
We need to bump the number of files we expect to have formatting violations following #10093
## Summary This is a not-unpopular directory name, and it's led to tons of issues and user confusion (most recently: astral-sh/ruff-pre-commit#69). I've wanted to remove it for a long time, but we need to do so as part of a minor release.
Summary
This is a not-unpopular directory name, and it's led to tons of issues and user confusion (most recently: astral-sh/ruff-pre-commit#69). I've wanted to remove it for a long time, but we need to do so as part of a minor release.