Skip to content
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

Fix bug where selection included deprecated rules during preview #9746

Merged
merged 5 commits into from
Feb 1, 2024

Conversation

zanieb
Copy link
Member

@zanieb zanieb commented Jan 31, 2024

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
#	crates/ruff_linter/src/rule_selector.rs
# Conflicts:
#	crates/ruff/tests/integration_test.rs
#	crates/ruff_linter/src/rule_selector.rs
#	crates/ruff_workspace/src/configuration.rs
# Conflicts:
#	crates/ruff/tests/integration_test.rs
#	crates/ruff_workspace/src/configuration.rs
@zanieb zanieb added the internal An internal refactor or improvement label Jan 31, 2024
Copy link
Contributor

ruff-ecosystem results

Linter (stable)

ℹ️ ecosystem check encountered linter errors. (no lint changes; 1 project error)

sphinx-doc/sphinx (error)

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 unstable rules without the `--preview` flag is not allowed. Enable preview or remove selection of:
	- FURB131
	- FURB113
	- FURB132

Linter (preview)

ℹ️ ecosystem check detected linter changes. (+1 -33929 violations, +0 -0 fixes in 4 projects; 2 project errors; 37 projects unchanged)

apache/airflow (+0 -22899 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --output-format concise --preview --select ALL

- airflow/api/__init__.py:46:9: TRY200 Use `raise from` to specify exception cause
- 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
- airflow/api/client/api_client.py:63:21: ANN101 Missing type annotation for `self` in method
- airflow/api/client/api_client.py:73:21: ANN101 Missing type annotation for `self` in method
- airflow/api/client/api_client.py:80:21: ANN101 Missing type annotation for `self` in method
- airflow/api/client/json_client.py:100:19: ANN101 Missing type annotation for `self` in method
- airflow/api/client/json_client.py:111:21: ANN101 Missing type annotation for `self` in method
- airflow/api/client/json_client.py:132:21: ANN101 Missing type annotation for `self` in method
... 22043 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/get_code.py:41:9: TRY200 Use `raise from` to specify exception cause
- airflow/api/common/experimental/pool.py:65:9: TRY200 Use `raise from` to specify exception cause
- 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
- airflow/api_connexion/endpoints/connection_endpoint.py:169:9: TRY200 Use `raise from` to specify exception cause
- airflow/api_connexion/endpoints/connection_endpoint.py:206:9: TRY200 Use `raise from` to specify exception cause
- airflow/api_connexion/endpoints/dag_endpoint.py:138:9: TRY200 Use `raise from` to specify exception cause
- airflow/api_connexion/endpoints/dag_endpoint.py:148:9: TRY200 Use `raise from` to specify exception cause
- airflow/api_connexion/endpoints/dag_endpoint.py:171:9: TRY200 Use `raise from` to specify exception cause
- airflow/api_connexion/endpoints/dag_endpoint.py:220:9: TRY200 Use `raise from` to specify exception cause
... 351 additional changes omitted for rule TRY200
- 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: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
- airflow/exceptions.py:223:15: ANN102 Missing type annotation for `cls` in classmethod
- airflow/executors/base_executor.py:498:21: ANN102 Missing type annotation for `cls` in classmethod
- airflow/executors/executor_loader.py:121:9: ANN102 Missing type annotation for `cls` in classmethod
... 22866 additional changes omitted for project

bokeh/bokeh (+0 -4125 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --output-format concise --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
... 4115 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/tests/test_graph.py:25:22: RUF023 [*] `MyNode.__match_args__` is not sorted

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

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.

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 (4 rules affected)

code total + violation - violation + fix - fix
ANN101 32681 0 32681 0 0
TRY200 636 0 636 0 0
ANN102 612 0 612 0 0
RUF023 1 1 0 0 0

@zanieb zanieb merged commit 6117ae7 into release/0.2.0 Feb 1, 2024
17 checks passed
@zanieb zanieb deleted the zb/fix-preview-deprecated branch February 1, 2024 14:45
zanieb added a commit that referenced this pull request Feb 1, 2024
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
zanieb added a commit that referenced this pull request Feb 1, 2024
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal An internal refactor or improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant