-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add handling for rules that are both deprecated and redirected #9714
Conversation
CodSpeed Performance ReportMerging #9714 will not alter performanceComparing Summary
|
(PygrepHooks, "005") => (RuleGroup::Stable, rules::pygrep_hooks::rules::InvalidMockAccess), | ||
(PygrepHooks, "001") => (RuleGroup::Deprecated, rules::pygrep_hooks::rules::Eval), | ||
(PygrepHooks, "002") => (RuleGroup::Deprecated, rules::pygrep_hooks::rules::DeprecatedLogWarn), | ||
(PygrepHooks, "003") => (RuleGroup::Deprecated, rules::pygrep_hooks::rules::BlanketTypeIgnore), |
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.
Should we deprecate these despite not having replacements for them?
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.
I dislike the category but the specific rules seem... ok.
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.
I thought we had decided that already in #8931? I guess I don't see any problems with these other rules though?
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.
I still want to deprecate the category since it's unfocused, but I think we'd need to find new homes for the others. I'd vote just deprecate the two for now.
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.
Okay works for 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.
Really slick!
Eh we have a problem here where redirected rules are being treated as stable when in preview... I need to investigate further. |
|
code | total | + violation | - violation | + fix | - fix |
---|---|---|---|---|---|
PGH001 | 27 | 26 | 1 | 0 | 0 |
RUF100 | 1 | 1 | 0 | 0 | 0 |
Linter (preview)
ℹ️ ecosystem check detected linter changes. (+1 -34464 violations, +0 -0 fixes in 6 projects; 4 project errors; 33 projects unchanged)
apache/airflow (+0 -23410 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --output-format concise --preview --select ALL
- airflow/__init__.py:59:67: PGH003 Use specific rule codes when ignoring type issues - airflow/api/__init__.py:46:9: TRY200 Use `raise from` to specify exception cause - airflow/api/auth/backend/kerberos_auth.py:55:85: PGH003 Use specific rule codes when ignoring type issues - airflow/api/auth/backend/kerberos_auth.py:73:18: ANN101 Missing type annotation for `self` in method - airflow/api/client/api_client.py:27:18: ANN101 Missing type annotation for `self` in method - airflow/api/client/api_client.py:33:21: ANN101 Missing type annotation for `self` in method - airflow/api/client/api_client.py:45:20: ANN101 Missing type annotation for `self` in method - airflow/api/client/api_client.py:52:18: ANN101 Missing type annotation for `self` in method - airflow/api/client/api_client.py:59:19: ANN101 Missing type annotation for `self` in method ... 22044 additional changes omitted for rule ANN101 - airflow/api/client/local_client.py:80:13: TRY200 Use `raise from` to specify exception cause - airflow/api/common/experimental/delete_dag.py:23:46: PGH004 Use specific rule codes when using `noqa` - airflow/api/common/experimental/get_code.py:41:9: TRY200 Use `raise from` to specify exception cause - airflow/api/common/experimental/mark_tasks.py:23:46: PGH004 Use specific rule codes when using `noqa` - airflow/api/common/experimental/pool.py:65:9: TRY200 Use `raise from` to specify exception cause - airflow/api/common/experimental/trigger_dag.py:23:47: PGH004 Use specific rule codes when using `noqa` - airflow/api_connexion/endpoints/connection_endpoint.py:131:9: TRY200 Use `raise from` to specify exception cause - airflow/api_connexion/endpoints/connection_endpoint.py:164:9: TRY200 Use `raise from` to specify exception cause ... 357 additional changes omitted for rule TRY200 - airflow/api_connexion/schemas/dag_schema.py:107:55: PGH003 Use specific rule codes when ignoring type issues - 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/compat/functools.py:31:40: PGH003 Use specific rule codes when ignoring type issues - airflow/configuration.py:1592:61: PGH003 Use specific rule codes when ignoring type issues - airflow/dag_processing/manager.py:1301:93: PGH003 Use specific rule codes when ignoring type issues ... 421 additional changes omitted for rule PGH003 - airflow/dag_processing/manager.py:496:9: ANN102 Missing type annotation for `cls` in classmethod - airflow/dag_processing/processor.py:420:21: ANN102 Missing type annotation for `cls` in classmethod - airflow/dag_processing/processor.py:795:21: ANN102 Missing type annotation for `cls` in classmethod ... 478 additional changes omitted for rule ANN102 - airflow/hooks/dbapi.py:25:25: PGH004 Use specific rule codes when using `noqa` - airflow/hooks/dbapi.py:26:17: PGH004 Use specific rule codes when using `noqa` - airflow/macros/__init__.py:20:14: PGH004 Use specific rule codes when using `noqa` ... 44 additional changes omitted for rule PGH004 - dev/stats/get_important_pr_candidates.py:131:32: PGH001 No builtin `eval()` allowed - tests/providers/amazon/aws/executors/ecs/test_ecs_executor.py:1135:16: PGH005 Non-existent mock method: `called_once` - tests/providers/amazon/aws/operators/test_eks.py:568:9: PGH005 Mock method should be called: `assert_called_once` ... 23377 additional changes omitted for project
bokeh/bokeh (+0 -4146 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --output-format concise --preview --select ALL
- docs/bokeh/docserver.py:99:39: PGH003 Use specific rule codes when ignoring type issues - 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/plotting/glyphs.py:8:5: PGH004 Use specific rule codes when using `noqa` - 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 - release/util.py:32:38: PGH003 Use specific rule codes when ignoring type issues - setup.py:159:22: PGH003 Use specific rule codes when ignoring type issues ... 4136 additional changes omitted for project
ibis-project/ibis (+1 -0 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --output-format concise --preview
+ ibis/common/typing.py:206:69: RUF100 Unused `noqa` directive (non-enabled: `S307`)
milvus-io/pymilvus (+0 -1 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --output-format concise --preview
- _version_helper.py:13:50: PGH004 Use specific rule codes when using `noqa`
rotki/rotki (+0 -2 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --output-format concise --preview
- pytestgeventwrapper.py:1:48: PGH004 Use specific rule codes when using `noqa` - pytestgeventwrapper.py:2:34: PGH004 Use specific rule codes when using `noqa`
zulip/zulip (+0 -6905 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --output-format concise --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 ... 6614 additional changes omitted for rule ANN101 - analytics/views/stats.py:156:9: TRY200 Use `raise from` to specify exception cause - confirmation/models.py:102:9: TRY200 Use `raise from` to specify exception cause - corporate/lib/registration.py:115:9: TRY200 Use `raise from` to specify exception cause - corporate/lib/remote_billing_util.py:124:9: TRY200 Use `raise from` to specify exception cause ... 6895 additional changes omitted for project
demisto/content (error)
ruff check --no-cache --exit-zero --output-format concise --preview
warning: The top-level linter settings are deprecated in favour of their counterparts in the `lint` section. Please update the following options in your configuration:
- 'ignore' -> 'lint.ignore'
- 'select' -> 'lint.select'
- 'unfixable' -> 'lint.unfixable'
- 'per-file-ignores' -> 'lint.per-file-ignores'
ruff failed
Cause: Selection of deprecated rules is not allowed when preview is enabled. Remove selection of:
- PGH002 (use `G010` instead)
- PGH001 (use `S307` instead)
fronzbot/blinkpy (error)
ruff check --no-cache --exit-zero --output-format concise --preview
warning: The top-level linter settings are deprecated in favour of their counterparts in the `lint` section. Please update the following options in your configuration:
- 'ignore' -> 'lint.ignore'
- 'select' -> 'lint.select'
- 'mccabe' -> 'lint.mccabe'
- 'per-file-ignores' -> 'lint.per-file-ignores'
ruff failed
Cause: Selection of deprecated rule `TRY200` is not allowed when preview mode is enabled.
python/mypy (error)
ruff check --no-cache --exit-zero --output-format concise --preview
warning: The top-level linter settings are deprecated in favour of their counterparts in the `lint` section. Please update the following options in your configuration:
- 'ignore' -> 'lint.ignore'
- 'select' -> 'lint.select'
- 'unfixable' -> 'lint.unfixable'
- 'isort' -> 'lint.isort'
ruff failed
Cause: Selection of deprecated rule `PGH004` is not allowed when preview is enabled.
sphinx-doc/sphinx (error)
ruff check --no-cache --exit-zero --output-format concise --preview
warning: The `show-source` option has been deprecated in favor of `output-format`'s "full" and "concise" variants. Please update your configuration to use `output-format = <full|concise>` instead.
ruff failed
Cause: Selection of deprecated rule `ANN102` is not allowed when preview mode is enabled.
Changes by rule (8 rules affected)
code | total | + violation | - violation | + fix | - fix |
---|---|---|---|---|---|
ANN101 | 32676 | 0 | 32676 | 0 | 0 |
TRY200 | 636 | 0 | 636 | 0 | 0 |
ANN102 | 612 | 0 | 612 | 0 | 0 |
PGH003 | 444 | 0 | 444 | 0 | 0 |
PGH004 | 55 | 0 | 55 | 0 | 0 |
PGH005 | 40 | 0 | 40 | 0 | 0 |
RUF100 | 1 | 1 | 0 | 0 | 0 |
PGH001 | 1 | 0 | 1 | 0 | 0 |
Cherry-picked from #9714 which is being abandoned for now because we need to invest more into our redirection infrastructure before it is feasible. Fixes a bug in the implementation where we improperly included deprecated rules in `RuleSelector.rules()` when preview is on. Includes some clean-up of error messages and the implementation.
Cherry-picked from #9714 which is being abandoned for now because we need to invest more into our redirection infrastructure before it is feasible. Fixes a bug in the implementation where we improperly included deprecated rules in `RuleSelector.rules()` when preview is on. Includes some clean-up of error messages and the implementation. # Conflicts: # crates/ruff/tests/integration_test.rs
Cherry-picked from #9714 which is being abandoned for now because we need to invest more into our redirection infrastructure before it is feasible. Fixes a bug in the implementation where we improperly included deprecated rules in `RuleSelector.rules()` when preview is on. Includes some clean-up of error messages and the implementation. # Conflicts: # crates/ruff/tests/integration_test.rs
Follow up to #9689 adds tooling for warning on rules that are deprecated because we replaced them with another rule.
Previously we would display no warnings for deprecated redirected rules because the redirect took place before the warnings could be displayed.
As with the other changes, this is immediately used for testing. Deprecates all of the
PGH
rules and adds redirects where relevant.Closes #8931