ruff
ruff copied to clipboard
Added ignoring deprecated rules for --select=ALL
Summary
#10342: Added ignoring deprecated rules for --select=ALL
Test Plan
Changed integration tests with --select=ALL option
ruff-ecosystem results
Linter (stable)
ℹ️ ecosystem check detected linter changes. (+1 -35120 violations, +0 -0 fixes in 3 projects; 41 projects unchanged)
apache/airflow (+1 -24265 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --no-preview --select ALL
- airflow/api/auth/backend/kerberos_auth.py:69:18: ANN101 Missing type annotation for `self` in method - airflow/api/client/api_client.py:28:18: ANN101 Missing type annotation for `self` in method - airflow/api/client/api_client.py:34:21: ANN101 Missing type annotation for `self` in method - airflow/api/client/api_client.py:46:20: ANN101 Missing type annotation for `self` in method - airflow/api/client/api_client.py:53:18: ANN101 Missing type annotation for `self` in method - airflow/api/client/api_client.py:60:19: ANN101 Missing type annotation for `self` in method - airflow/api/client/api_client.py:64:21: ANN101 Missing type annotation for `self` in method - airflow/api/client/api_client.py:74:21: ANN101 Missing type annotation for `self` in method - airflow/api/client/api_client.py:81:21: ANN101 Missing type annotation for `self` in method - airflow/api/client/json_client.py:101:19: ANN101 Missing type annotation for `self` in method - airflow/api/client/json_client.py:112:21: ANN101 Missing type annotation for `self` in method - airflow/api/client/json_client.py:133:21: ANN101 Missing type annotation for `self` in method ... 23731 additional changes omitted for rule ANN101 - airflow/callbacks/callback_requests.py:57:19: ANN102 Missing type annotation for `cls` in classmethod - airflow/callbacks/callback_requests.py:95:19: ANN102 Missing type annotation for `cls` in classmethod - airflow/cli/commands/standalone_command.py:51:20: ANN102 Missing type annotation for `cls` in classmethod - airflow/dag_processing/manager.py:497:9: ANN102 Missing type annotation for `cls` in classmethod - airflow/dag_processing/processor.py:421:21: ANN102 Missing type annotation for `cls` in classmethod - airflow/dag_processing/processor.py:796:21: ANN102 Missing type annotation for `cls` in classmethod - airflow/exceptions.py:245:15: ANN102 Missing type annotation for `cls` in classmethod - airflow/executors/base_executor.py:512:21: ANN102 Missing type annotation for `cls` in classmethod - airflow/executors/executor_loader.py:158:28: ANN102 Missing type annotation for `cls` in classmethod - airflow/executors/executor_loader.py:166:35: ANN102 Missing type annotation for `cls` in classmethod - airflow/executors/executor_loader.py:175:30: ANN102 Missing type annotation for `cls` in classmethod - airflow/executors/executor_loader.py:182:24: ANN102 Missing type annotation for `cls` in classmethod ... 511 additional changes omitted for rule ANN102 + airflow/utils/pydantic.py:60:13: D107 Missing docstring in `__init__` - airflow/utils/pydantic.py:60:13: D107 Missing docstring in `__init__` ... 24240 additional changes omitted for project
bokeh/bokeh (+0 -4088 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --no-preview --select ALL
- examples/output/apis/autoload_static.py:32:20: ANN101 Missing type annotation for `self` in method - examples/output/apis/autoload_static.py:34:13: ANN101 Missing type annotation for `self` in method - examples/output/apis/autoload_static.py:41:20: ANN101 Missing type annotation for `self` in method - examples/output/apis/autoload_static.py:43:13: ANN101 Missing type annotation for `self` in method - examples/server/api/tornado_embed.py:15:13: ANN101 Missing type annotation for `self` in method - examples/server/app/server_auth/auth.py:27:13: ANN101 Missing type annotation for `self` in method ... 4003 additional changes omitted for rule ANN101 - src/bokeh/client/session.py:524:28: ANN102 Missing type annotation for `cls` in classmethod - src/bokeh/colors/color.py:115:18: ANN102 Missing type annotation for `cls` in classmethod - src/bokeh/colors/color.py:132:18: ANN102 Missing type annotation for `cls` in classmethod - src/bokeh/colors/color.py:245:18: ANN102 Missing type annotation for `cls` in classmethod ... 4078 additional changes omitted for project
zulip/zulip (+0 -6767 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --no-preview --select ALL
- analytics/lib/counts.py:105:9: ANN101 Missing type annotation for `self` in method - analytics/lib/counts.py:112:26: ANN101 Missing type annotation for `self` in method - analytics/lib/counts.py:49:24: ANN101 Missing type annotation for `self` in method - analytics/lib/counts.py:55:9: ANN101 Missing type annotation for `self` in method - analytics/lib/counts.py:73:18: ANN101 Missing type annotation for `self` in method - analytics/lib/counts.py:76:30: ANN101 Missing type annotation for `self` in method ... 6712 additional changes omitted for rule ANN101 - corporate/models.py:187:45: ANN102 Missing type annotation for `cls` in classmethod - zerver/lib/narrow.py:90:22: ANN102 Missing type annotation for `cls` in classmethod - zerver/lib/notes.py:40:19: ANN102 Missing type annotation for `cls` in classmethod - zerver/lib/notes.py:48:19: ANN102 Missing type annotation for `cls` in classmethod ... 6757 additional changes omitted for project
Changes by rule (3 rules affected)
| code | total | + violation | - violation | + fix | - fix |
|---|---|---|---|---|---|
| ANN101 | 34467 | 0 | 34467 | 0 | 0 |
| ANN102 | 652 | 0 | 652 | 0 | 0 |
| D107 | 2 | 1 | 1 | 0 | 0 |
Linter (preview)
✅ ecosystem check detected no linter changes.
Is this a breaking change because we remove rules from a selector?
@MichaReiser that's a good call... maybe. It'd be easy to hold off merging until v0.4.0 which seems reasonable.
It might be fine, at least from our versioning policy.
The change is reasonable to me but it might be worth documenting that all selects all not deprecated rules to make it clear to users that they might "loose" rules even when upgrading to a new patch version
hi, this changed was planned for version v0.4.0, but moved to v0.5.0
what is the reason behind this choice?
Hey @Alexdelia, we ended up releasing the parser in 0.4.0 and focused on delivery of that. We routinely move things to later milestones when they aren't high priority for the given release.
I tested that running ruff without preview no longer raises MissingTypeSelf when using --select ALL. ANN keeps being raised when using --select ANN.
To me this raises the question if deprecated rules should be removed from all non-exact selectors. It now feels kind of inconsistent that using ALL deselect deprecated rules but ANN doesn't
I'll go ahead with merging this. It's heading in the right direction but we might need to figure out how we want to handle deprecation in combination with other group selectors.