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

[ruff] Unnecessary intermediate representation (RUF042) #14831

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

InSyncWithFoo
Copy link
Contributor

@InSyncWithFoo InSyncWithFoo commented Dec 8, 2024

Summary

Resolves #13533, resolves #14518 as well as the follow-up for #14564 and #14580.

Test Plan

cargo nextest run and cargo insta test.

Copy link
Contributor

github-actions bot commented Dec 8, 2024

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

ℹ️ ecosystem check detected linter changes. (+261 -0 violations, +0 -0 fixes in 20 projects; 35 projects unchanged)

DisnakeDev/disnake (+2 -0 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview

+ noxfile.py:112:9: RUF042 [*] Unnecessary intermediate representation
+ tests/test_utils.py:196:5: RUF042 [*] Unnecessary intermediate representation

RasaHQ/rasa (+24 -0 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview

+ rasa/core/channels/twilio.py:58:13: RUF042 [*] Unnecessary intermediate representation
+ rasa/core/migrate.py:131:13: RUF042 [*] Unnecessary intermediate representation
+ rasa/core/migrate.py:143:9: RUF042 [*] Unnecessary intermediate representation
+ rasa/core/migrate.py:177:13: RUF042 [*] Unnecessary intermediate representation
+ rasa/core/migrate.py:179:13: RUF042 [*] Unnecessary intermediate representation
+ rasa/core/migrate.py:181:13: RUF042 [*] Unnecessary intermediate representation
+ rasa/core/migrate.py:185:13: RUF042 [*] Unnecessary intermediate representation
+ rasa/shared/core/domain.py:1898:17: RUF042 [*] Unnecessary intermediate representation
+ rasa/shared/core/domain.py:1915:25: RUF042 [*] Unnecessary intermediate representation
+ rasa/shared/core/domain.py:393:13: RUF042 [*] Unnecessary intermediate representation
... 14 additional changes omitted for project

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

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

+ airflow/cli/commands/local_commands/webserver_command.py:401:13: RUF042 [*] Unnecessary intermediate representation
+ airflow/models/abstractoperator.py:369:17: RUF042 [*] Unnecessary intermediate representation
+ airflow/models/dag.py:1457:13: RUF042 [*] Unnecessary intermediate representation
+ airflow/models/taskinstance.py:2005:13: RUF042 [*] Unnecessary intermediate representation
+ airflow/models/taskinstance.py:2007:13: RUF042 [*] Unnecessary intermediate representation
+ airflow/models/taskinstance.py:2009:13: RUF042 [*] Unnecessary intermediate representation
+ airflow/models/taskinstance.py:2015:13: RUF042 [*] Unnecessary intermediate representation
+ airflow/models/taskinstance.py:2017:13: RUF042 [*] Unnecessary intermediate representation
+ airflow/models/taskinstance.py:2021:13: RUF042 [*] Unnecessary intermediate representation
+ airflow/serialization/serialized_objects.py:1251:9: RUF042 [*] Unnecessary intermediate representation
+ airflow/serialization/serialized_objects.py:1331:25: RUF042 [*] Unnecessary intermediate representation
+ airflow/serialization/serialized_objects.py:1605:13: RUF042 [*] Unnecessary intermediate representation
+ airflow/utils/file.py:214:13: RUF042 [*] Unnecessary intermediate representation
+ dev/breeze/src/airflow_breeze/commands/release_management_commands.py:2975:9: RUF042 [*] Unnecessary intermediate representation
+ dev/breeze/src/airflow_breeze/commands/release_management_commands.py:594:13: RUF042 [*] Unnecessary intermediate representation
+ dev/breeze/src/airflow_breeze/utils/docker_command_utils.py:346:5: RUF042 [*] Unnecessary intermediate representation
+ dev/breeze/src/airflow_breeze/utils/docker_command_utils.py:351:5: RUF042 [*] Unnecessary intermediate representation
+ dev/breeze/src/airflow_breeze/utils/docker_command_utils.py:358:5: RUF042 [*] Unnecessary intermediate representation
... 77 additional changes omitted for project

apache/superset (+13 -0 violations, +0 -0 fixes)

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

+ superset/commands/chart/data/get_data_command.py:62:13: RUF042 [*] Unnecessary intermediate representation
+ superset/databases/utils.py:80:9: RUF042 [*] Unnecessary intermediate representation
+ superset/models/helpers.py:1954:17: RUF042 [*] Unnecessary intermediate representation
+ superset/models/helpers.py:2005:17: RUF042 [*] Unnecessary intermediate representation
+ superset/sql_lab.py:512:17: RUF042 [*] Unnecessary intermediate representation
+ superset/sql_lab.py:538:17: RUF042 [*] Unnecessary intermediate representation
+ superset/tasks/cache.py:227:13: RUF042 [*] Unnecessary intermediate representation
+ superset/views/core.py:692:13: RUF042 [*] Unnecessary intermediate representation
+ superset/views/utils.py:227:25: RUF042 [*] Unnecessary intermediate representation
+ superset/viz.py:1959:13: RUF042 [*] Unnecessary intermediate representation
... 3 additional changes omitted for project

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

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

+ src/bokeh/models/util/structure.py:242:13: RUF042 [*] Unnecessary intermediate representation
+ src/bokeh/models/util/structure.py:243:13: RUF042 [*] Unnecessary intermediate representation
+ tests/support/util/screenshot.py:92:9: RUF042 [*] Unnecessary intermediate representation

ibis-project/ibis (+1 -0 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview

+ ibis/backends/sql/compilers/bigquery/__init__.py:288:9: RUF042 [*] Unnecessary intermediate representation

latchbio/latch (+3 -0 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview

+ src/latch_cli/docker_utils/__init__.py:134:9: RUF042 [*] Unnecessary intermediate representation
+ src/latch_cli/docker_utils/__init__.py:321:9: RUF042 [*] Unnecessary intermediate representation
+ src/latch_cli/docker_utils/__init__.py:84:5: RUF042 [*] Unnecessary intermediate representation

lnbits/lnbits (+17 -0 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview

+ lnbits/core/views/api.py:102:9: RUF042 [*] Unnecessary intermediate representation
+ lnbits/core/views/api.py:103:9: RUF042 [*] Unnecessary intermediate representation
+ lnbits/core/views/api.py:107:9: RUF042 [*] Unnecessary intermediate representation
+ lnbits/core/views/api.py:132:13: RUF042 [*] Unnecessary intermediate representation
+ lnbits/core/views/api.py:143:17: RUF042 [*] Unnecessary intermediate representation
+ lnbits/core/views/api.py:144:17: RUF042 [*] Unnecessary intermediate representation
+ lnbits/core/views/api.py:153:21: RUF042 [*] Unnecessary intermediate representation
+ lnbits/core/views/api.py:159:17: RUF042 [*] Unnecessary intermediate representation
+ lnbits/core/views/api.py:161:17: RUF042 [*] Unnecessary intermediate representation
+ lnbits/core/views/api.py:162:17: RUF042 [*] Unnecessary intermediate representation
... 7 additional changes omitted for project

milvus-io/pymilvus (+2 -0 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview

+ examples/orm/collection.py:163:9: RUF042 [*] Unnecessary intermediate representation
+ examples/orm/partition.py:98:9: RUF042 [*] Unnecessary intermediate representation

pypa/build (+1 -0 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview

+ src/build/env.py:300:13: RUF042 [*] Unnecessary intermediate representation

pypa/cibuildwheel (+3 -0 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview

+ bin/run_tests.py:33:9: RUF042 [*] Unnecessary intermediate representation
+ bin/run_tests.py:54:9: RUF042 [*] Unnecessary intermediate representation
+ cibuildwheel/macos.py:171:17: RUF042 [*] Unnecessary intermediate representation

rotki/rotki (+6 -0 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview

+ rotkehlchen/api/rest.py:1943:13: RUF042 [*] Unnecessary intermediate representation
+ rotkehlchen/exchanges/bitstamp.py:259:21: RUF042 [*] Unnecessary intermediate representation
+ rotkehlchen/exchanges/bitstamp.py:414:17: RUF042 [*] Unnecessary intermediate representation
+ rotkehlchen/exchanges/poloniex.py:189:13: RUF042 [*] Unnecessary intermediate representation
+ rotkehlchen/tests/unit/accounting/test_settings.py:211:5: RUF042 [*] Unnecessary intermediate representation
+ rotkehlchen/tests/unit/globaldb/test_globaldb.py:871:13: RUF042 [*] Unnecessary intermediate representation

scikit-build/scikit-build (+2 -0 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview

+ tests/test_cmaker.py:119:13: RUF042 [*] Unnecessary intermediate representation
+ tests/test_setup.py:856:13: RUF042 [*] Unnecessary intermediate representation

scikit-build/scikit-build-core (+3 -0 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview

+ src/scikit_build_core/build/wheel.py:433:17: RUF042 [*] Unnecessary intermediate representation
+ src/scikit_build_core/build/wheel.py:434:17: RUF042 [*] Unnecessary intermediate representation
+ src/scikit_build_core/cmake.py:286:13: RUF042 [*] Unnecessary intermediate representation

zulip/zulip (+35 -0 violations, +0 -0 fixes)

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

+ analytics/urls.py:28:5: RUF042 [*] Unnecessary intermediate representation
+ analytics/urls.py:58:5: RUF042 [*] Unnecessary intermediate representation
+ corporate/tests/test_stripe.py:655:13: RUF042 [*] Unnecessary intermediate representation
+ corporate/urls.py:228:5: RUF042 [*] Unnecessary intermediate representation
+ corporate/urls.py:235:1: RUF042 [*] Unnecessary intermediate representation
+ corporate/views/remote_billing_page.py:529:9: RUF042 [*] Unnecessary intermediate representation
+ corporate/views/remote_billing_page.py:538:9: RUF042 [*] Unnecessary intermediate representation
+ corporate/views/remote_billing_page.py:548:9: RUF042 [*] Unnecessary intermediate representation
+ corporate/views/remote_billing_page.py:552:9: RUF042 [*] Unnecessary intermediate representation
+ zerver/lib/event_schema.py:269:9: RUF042 [*] Unnecessary intermediate representation
... 25 additional changes omitted for project

... Truncated remaining completed project reports due to GitHub comment length restrictions

Changes by rule (1 rules affected)

code total + violation - violation + fix - fix
RUF042 261 261 0 0 0

@InSyncWithFoo
Copy link
Contributor Author

InSyncWithFoo commented Dec 8, 2024

This is a 12-in-1 rule. All the patterns are needed to preserve consistency with the reframing in #14564. I'm sorry it couldn't have been made as small as a weekend PR should be.

@MichaReiser MichaReiser added rule Implementing or modifying a lint rule needs-decision Awaiting a decision from a maintainer labels Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-decision Awaiting a decision from a maintainer rule Implementing or modifying a lint rule
Projects
None yet
2 participants