-
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
Warn instead of error when removed rules are used in ignore #14435
Conversation
bc6d258
to
2a831b9
Compare
|
code | total | + violation | - violation | + fix | - fix |
---|---|---|---|---|---|
TC001 | 352 | 352 | 0 | 0 | 0 |
TCH001 | 352 | 0 | 352 | 0 | 0 |
TC003 | 198 | 198 | 0 | 0 | 0 |
TCH003 | 198 | 0 | 198 | 0 | 0 |
TC002 | 147 | 147 | 0 | 0 | 0 |
TCH002 | 147 | 0 | 147 | 0 | 0 |
RUF101 | 46 | 46 | 0 | 0 | 0 |
D212 | 2 | 1 | 1 | 0 | 0 |
TC005 | 2 | 2 | 0 | 0 | 0 |
TCH005 | 2 | 0 | 2 | 0 | 0 |
TCH004 | 2 | 0 | 2 | 0 | 0 |
Linter (preview)
ℹ️ ecosystem check detected linter changes. (+9089 -9065 violations, +0 -66 fixes in 11 projects; 1 project error; 42 projects unchanged)
apache/airflow (+6295 -6294 violations, +0 -58 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview --select ALL
+ airflow/__main__.py:25:22: TC003 Move standard library import `argparse.Namespace` into a type-checking block - airflow/__main__.py:25:22: TCH003 Move standard library import `argparse.Namespace` into a type-checking block - airflow/api/__init__.py:32:5: DOC201 `return` is not documented in docstring - airflow/api/__init__.py:32:5: DOC501 Raised exception `AirflowException` missing from docstring + airflow/api/__init__.py:43:15: DOC501 Raised exception `AirflowException` missing from docstring + airflow/api/__init__.py:44:5: DOC201 `return` is not documented in docstring - airflow/api/auth/backend/deny_all.py:38:5: DOC201 `return` is not documented in docstring + airflow/api/auth/backend/deny_all.py:44:5: DOC201 `return` is not documented in docstring - airflow/api/client/__init__.py:27:5: DOC201 `return` is not documented in docstring + airflow/api/client/__init__.py:38:5: DOC201 `return` is not documented in docstring ... 9025 additional changes omitted for rule DOC201 - airflow/api/common/delete_dag.py:43:5: DOC501 Raised exception `AirflowException` missing from docstring - airflow/api/common/delete_dag.py:43:5: DOC501 Raised exception `DagNotFound` missing from docstring + airflow/api/common/delete_dag.py:61:15: DOC501 Raised exception `AirflowException` missing from docstring + airflow/api/common/delete_dag.py:64:15: DOC501 Raised exception `DagNotFound` missing from docstring ... 2953 additional changes omitted for rule DOC501 - airflow/api/common/mark_tasks.py:186:5: DOC402 `yield` is not documented in docstring + airflow/api/common/mark_tasks.py:190:13: DOC402 `yield` is not documented in docstring + airflow/api_connexion/schemas/asset_schema.py:19:22: TC003 Move standard library import `datetime.datetime` into a type-checking block - airflow/api_connexion/schemas/asset_schema.py:19:22: TCH003 Move standard library import `datetime.datetime` into a type-checking block - airflow/api_fastapi/common/db/common.py:33:5: DOC402 `yield` is not documented in docstring + airflow/api_fastapi/common/db/common.py:47:9: DOC402 `yield` is not documented in docstring + airflow/api_fastapi/common/parameters.py:21:22: TC003 Move standard library import `datetime.datetime` into a type-checking block - airflow/api_fastapi/common/parameters.py:21:22: TCH003 Move standard library import `datetime.datetime` into a type-checking block + airflow/api_fastapi/common/router.py:20:18: TC003 Move standard library import `enum.Enum` into a type-checking block - airflow/api_fastapi/common/router.py:20:18: TCH003 Move standard library import `enum.Enum` into a type-checking block + airflow/api_fastapi/common/types.py:19:22: TC003 Move standard library import `datetime.timedelta` into a type-checking block - airflow/api_fastapi/common/types.py:19:22: TCH003 Move standard library import `datetime.timedelta` into a type-checking block + airflow/api_fastapi/core_api/datamodels/assets.py:20:22: TC003 Move standard library import `datetime.datetime` into a type-checking block ... 105 additional changes omitted for rule TC003 - airflow/api_fastapi/core_api/datamodels/assets.py:20:22: TCH003 Move standard library import `datetime.datetime` into a type-checking block ... 105 additional changes omitted for rule TCH003 + airflow/assets/__init__.py:128:8: PLR1714 Consider merging multiple comparisons: `value in ("self", "context")`. Use a `set` if the elements are hashable. - airflow/assets/__init__.py:128:8: PLR1714 Consider merging multiple comparisons: `value in {"self", "context"}`. - airflow/assets/__init__.py:238:9: DOC402 `yield` is not documented in docstring + airflow/assets/__init__.py:243:9: DOC402 `yield` is not documented in docstring ... 329 additional changes omitted for rule DOC402 + airflow/decorators/__init__.pyi:117:25: PYI041 Use `float` instead of `int | float` - airflow/decorators/__init__.pyi:117:25: PYI041 [*] Use `float` instead of `int | float` ... 12613 additional changes omitted for project
apache/superset (+1491 -1493 violations, +0 -8 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview --select ALL
+ RELEASING/changelog.py:104:9: DOC201 `return` is not documented in docstring - RELEASING/changelog.py:107:9: DOC201 `return` is not documented in docstring + RELEASING/changelog.py:113:13: DOC201 `return` is not documented in docstring - RELEASING/changelog.py:52:9: DOC201 `return` is not documented in docstring + RELEASING/changelog.py:54:13: DOC201 `return` is not documented in docstring - RELEASING/changelog.py:87:9: DOC201 `return` is not documented in docstring ... 1824 additional changes omitted for rule DOC201 - scripts/benchmark_migration.py:43:5: DOC501 Raised exception `Exception` missing from docstring + scripts/benchmark_migration.py:51:11: DOC501 Raised exception `Exception` missing from docstring - scripts/cancel_github_workflows.py:162:5: DOC501 Raised exception `ClickException` missing from docstring + scripts/cancel_github_workflows.py:164:15: DOC501 Raised exception `ClickException` missing from docstring ... 2982 additional changes omitted for project
aws/aws-sam-cli (+1 -1 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview
+ tests/integration/publish/publish_app_integ_base.py:60:16: PLR1714 Consider merging multiple comparisons: `f.suffix in (".yaml", ".json")`. Use a `set` if the elements are hashable. - tests/integration/publish/publish_app_integ_base.py:60:16: PLR1714 Consider merging multiple comparisons: `f.suffix in {".yaml", ".json"}`.
bokeh/bokeh (+639 -638 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview --select ALL
+ examples/advanced/extensions/parallel_plot/parallel_plot.py:107:5: DOC201 `return` is not documented in docstring - examples/advanced/extensions/parallel_plot/parallel_plot.py:15:5: DOC201 `return` is not documented in docstring - examples/basic/data/server_sent_events_source.py:53:9: DOC402 `yield` is not documented in docstring + examples/basic/data/server_sent_events_source.py:60:13: DOC402 `yield` is not documented in docstring - examples/interaction/js_callbacks/js_on_event.py:16:5: DOC201 `return` is not documented in docstring + examples/interaction/js_callbacks/js_on_event.py:21:5: DOC201 `return` is not documented in docstring + examples/models/daylight.py:83:12: DTZ901 Use of `datetime.datetime.min` without timezone information - examples/models/gauges.py:33:5: DOC201 `return` is not documented in docstring + examples/models/gauges.py:34:5: DOC201 `return` is not documented in docstring ... 395 additional changes omitted for rule DOC201 + release/build.py:18:21: TC001 Move application import `.config.Config` into a type-checking block ... 1267 additional changes omitted for project
ibis-project/ibis (+42 -0 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview
+ ibis/backends/oracle/tests/test_client.py:3:36: RUF101 [*] `TCH003` is a redirect to `TC003` + ibis/backends/polars/rewrites.py:10:50: RUF101 [*] `TCH001` is a redirect to `TC001` + ibis/backends/sql/rewrites.py:17:57: RUF101 [*] `TCH001` is a redirect to `TC001` + ibis/backends/sql/rewrites.py:21:50: RUF101 [*] `TCH001` is a redirect to `TC001` + ibis/common/grounds.py:29:57: RUF101 [*] `TCH001` is a redirect to `TC001` + ibis/common/selectors.py:8:50: RUF101 [*] `TCH001` is a redirect to `TC001` + ibis/config.py:3:47: RUF101 [*] `TCH003` is a redirect to `TC003` + ibis/expr/builders.py:16:53: RUF101 [*] `TCH001` is a redirect to `TC001` + ibis/expr/builders.py:17:50: RUF101 [*] `TCH001` is a redirect to `TC001` + ibis/expr/datatypes/tests/test_core.py:3:26: RUF101 [*] `TCH003` is a redirect to `TC003` ... 32 additional changes omitted for project
latchbio/latch (+8 -9 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview
+ src/latch/ldata/_transfer/upload.py:10:38: TC003 Move standard library import `multiprocessing.managers.DictProxy` into a type-checking block - src/latch/ldata/_transfer/upload.py:10:38: TCH003 Move standard library import `multiprocessing.managers.DictProxy` into a type-checking block + src/latch/ldata/_transfer/upload.py:10:49: TC003 Move standard library import `multiprocessing.managers.ListProxy` into a type-checking block - src/latch/ldata/_transfer/upload.py:10:49: TCH003 Move standard library import `multiprocessing.managers.ListProxy` into a type-checking block + src/latch/ldata/_transfer/upload.py:12:19: TC003 Move standard library import `queue.Queue` into a type-checking block - src/latch/ldata/_transfer/upload.py:12:19: TCH003 Move standard library import `queue.Queue` into a type-checking block + src/latch/registry/record.py:18:49: TC001 Move application import `latch.registry.upstream_types.types.DBType` into a type-checking block - src/latch/registry/record.py:18:49: TCH001 Move application import `latch.registry.upstream_types.types.DBType` into a type-checking block - src/latch/types/metadata.py:500:45: PYI061 `Literal[None, ...]` can be replaced with `Literal[...] | None` + src/latch_cli/services/register/utils.py:5:8: TC003 Move standard library import `io` into a type-checking block ... 7 additional changes omitted for project
pandas-dev/pandas (+0 -5 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview
- pandas/core/dtypes/dtypes.py:76:23: TCH004 Move import `pyarrow` out of type-checking block. Import is used for more than type hinting. - pandas/core/groupby/groupby.py:4069:39: PYI061 `Literal[None, ...]` can be replaced with `Literal[...] | None` - pandas/core/groupby/indexing.py:299:39: PYI061 `Literal[None, ...]` can be replaced with `Literal[...] | None` - pandas/io/html.py:1027:28: PYI061 `Literal[None, ...]` can be replaced with `Literal[...] | None` - pandas/io/html.py:223:32: PYI061 `Literal[None, ...]` can be replaced with `Literal[...] | None`
... Truncated remaining completed project reports due to GitHub comment length restrictions
pypa/setuptools (error)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview
ruff failed
Cause: Failed to parse /home/runner/work/ruff/ruff/checkouts/pypa:setuptools/ruff.toml
Cause: TOML parse error at line 8, column 1
|
8 | [lint]
| ^^^^^^
Unknown rule selector: `UP027`
Changes by rule (22 rules affected)
code | total | + violation | - violation | + fix | - fix |
---|---|---|---|---|---|
DOC201 | 12121 | 6060 | 6061 | 0 | 0 |
DOC501 | 3928 | 1964 | 1964 | 0 | 0 |
DOC402 | 408 | 204 | 204 | 0 | 0 |
TC001 | 352 | 352 | 0 | 0 | 0 |
TCH001 | 352 | 0 | 352 | 0 | 0 |
TC003 | 198 | 198 | 0 | 0 | 0 |
TCH003 | 198 | 0 | 198 | 0 | 0 |
DOC202 | 158 | 79 | 79 | 0 | 0 |
TC002 | 147 | 147 | 0 | 0 | 0 |
TCH002 | 147 | 0 | 147 | 0 | 0 |
PYI041 | 68 | 2 | 0 | 0 | 66 |
PLR1714 | 62 | 31 | 31 | 0 | 0 |
RUF101 | 46 | 46 | 0 | 0 | 0 |
PYI061 | 14 | 0 | 14 | 0 | 0 |
RUF038 | 7 | 0 | 7 | 0 | 0 |
DOC502 | 4 | 2 | 2 | 0 | 0 |
TC005 | 2 | 2 | 0 | 0 | 0 |
DOC403 | 2 | 1 | 1 | 0 | 0 |
TCH005 | 2 | 0 | 2 | 0 | 0 |
TCH004 | 2 | 0 | 2 | 0 | 0 |
DTZ901 | 1 | 1 | 0 | 0 | 0 |
RUF100 | 1 | 0 | 1 | 0 | 0 |
I suspect that the setuptools check is still failing because it fails for the ruff-0.8 branch I have to look into what's up with pandas. I somehow suspect that it's panicking... but that's unrelated to this branch |
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 seems like a good idea to me!
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 is great, thank you!
crates/ruff_linter/src/rules/pyupgrade/rules/unpacked_list_comprehension.rs
Show resolved
Hide resolved
crates/ruff_linter/src/rules/pyupgrade/rules/unpacked_list_comprehension.rs
Outdated
Show resolved
Hide resolved
Okay, I don't know what's up with panda.... It passes just fine locally |
That's been happening on all PRs recently, I think... I also don't know the reason... |
ee94e12
to
7015a3f
Compare
Uh, the diff for pandas is:
|
7015a3f
to
25a2336
Compare
Just for consideration and because I'd like to at least have an official decision on this if not supported: What about rules that don't exists yet? Let's say Ruff adds Btw I'm not requesting this be supported here (I appreciate this improvement as-is!). Just at least considered eventually. |
@Avasam let's merge this as-is (since, among other things, it unblocks the ruff 0.8 release) and consider that separately for the future |
@Avasam if you'd like to open an issue for this that'd be helpful so the idea doesn't get lost 🙂 |
Oh I missed that part. We can keep the existing issue open. |
Summary
Emit a warning when users ignores a removed rule using
ignore
orextend-ignore
instead of erroring.The main reason for removing rules are:
It's common for users to explicitly ignore those rules, possibly in shared configurations used across multiple ruff versions.
That makes it difficult to use the same configuration with multiple ruff versions.
Another motivation is that removed rules result in failed ecosystem checks, which causes us to get a very low signal until the upstream projects update their settings.
This PR re-adds UP027 as a removed rule. This also has the advantage that it remains listed on our documentation and reduces the risk that we accidentally re-implement the rule or re-use the rule code.
Closes #13505
We should rebase #14384, #14385, and #14428 and mark those rules as removed instead of removing the codes entirely
Test Plan
Added tests. I manually ran
ruff check . --ignore UP027
andruff check . --extend-ignore UP027
to verify the behavior