-
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
[ruff 0.8][flake8-type-checking
] Rename TCH
to TC
#14438
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.
Awesome, thank you!
|
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 | 1 | 0 | 1 | 0 | 0 |
Linter (preview)
ℹ️ ecosystem check detected linter changes. (+9086 -9061 violations, +0 -66 fixes in 10 projects; 1 project error; 43 projects unchanged)
apache/airflow (+6292 -6291 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 ... 9021 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 ... 2951 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` ... 12607 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 | 12117 | 6058 | 6059 | 0 | 0 |
DOC501 | 3926 | 1963 | 1963 | 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 |
DTZ901 | 1 | 1 | 0 | 0 | 0 |
RUF100 | 1 | 0 | 1 | 0 | 0 |
TCH004 | 1 | 0 | 1 | 0 | 0 |
Closes #9573
Summary
This renames
TCH
toTC
to match the original flake8 plugin.Test Plan
cargo nextest run