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

[wps-light] Implement unused-variable-accessed (WPS121) #8

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

Conversation

Lokejoke
Copy link
Owner

@Lokejoke Lokejoke commented Nov 16, 2024

Summary

This PR implements unused-variable-accessed.
Checks if local variable marked as unused (leading underscore) is truly unused.

Test Plan

cargo test

@Lokejoke Lokejoke changed the title Unused variable accessed [wps-light] Implement Unused variable accessed (WPS121) Nov 16, 2024
@Lokejoke Lokejoke changed the title [wps-light] Implement Unused variable accessed (WPS121) [wps-light] Implement Unused variable accessed (WPS121) Nov 16, 2024
@Lokejoke Lokejoke changed the title [wps-light] Implement Unused variable accessed (WPS121) [wps-light] Implement unused-variable-accessed (WPS121) Nov 16, 2024
Copy link

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

ℹ️ ecosystem check detected linter changes. (+253 -0 violations, +0 -0 fixes in 4 projects; 50 projects unchanged)

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

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

+ airflow/api_connexion/endpoints/pool_endpoint.py:135:9: WPS121 Local variable `_patch_body` is marked as unused but is used
+ airflow/assets/manager.py:282:5: WPS121 Local variable `_asset_manager_class` is marked as unused but is used
+ airflow/assets/manager.py:287:5: WPS121 Local variable `_asset_manager_kwargs` is marked as unused but is used
+ airflow/cli/commands/connection_command.py:152:5: WPS121 Local variable `_connection_types` is marked as unused but is used
+ airflow/cli/commands/info_command.py:263:9: WPS121 Local variable `_locale` is marked as unused but is used
+ airflow/cli/commands/task_command.py:439:9: WPS121 Local variable `_dag` is marked as unused but is used
+ airflow/configuration.py:1297:13: WPS121 Local variable `_section` is marked as unused but is used
+ airflow/dag_processing/processor.py:234:26: WPS121 Local variable `_child_channel` is marked as unused but is used
+ airflow/dag_processing/processor.py:234:9: WPS121 Local variable `_parent_channel` is marked as unused but is used
+ airflow/decorators/base.py:486:9: WPS121 Local variable `_MappedOperator` is marked as unused but is used
+ airflow/executors/executor_loader.py:230:13: WPS121 Local variable `_executor_name` is marked as unused but is used
+ airflow/io/path.py:393:9: WPS121 Local variable `_kwargs` is marked as unused but is used
+ airflow/io/path.py:407:9: WPS121 Local variable `_kwargs` is marked as unused but is used
+ airflow/jobs/scheduler_job_runner.py:2269:9: WPS121 Local variable `_executor_to_tis` is marked as unused but is used
+ airflow/lineage/__init__.py:138:17: WPS121 Local variable `_inlets` is marked as unused but is used
+ airflow/lineage/__init__.py:73:5: WPS121 Local variable `_backend` is marked as unused but is used
+ airflow/lineage/hook.py:230:13: WPS121 Local variable `_hook_lineage_collector` is marked as unused but is used
+ airflow/lineage/hook.py:232:13: WPS121 Local variable `_hook_lineage_collector` is marked as unused but is used
+ airflow/listeners/listener.py:83:9: WPS121 Local variable `_listener_manager` is marked as unused but is used
+ airflow/models/crypto.py:83:13: WPS121 Local variable `_fernet` is marked as unused but is used
+ airflow/models/crypto.py:85:13: WPS121 Local variable `_fernet` is marked as unused but is used
+ airflow/models/variable.py:315:25: WPS121 Local variable `_backend_name` is marked as unused but is used
+ airflow/serialization/serialized_objects.py:1525:13: WPS121 Local variable `_operator_link_class_path` is marked as unused but is used
+ airflow/traces/otel_tracer.py:117:13: WPS121 Local variable `_links` is marked as unused but is used
+ airflow/traces/otel_tracer.py:150:9: WPS121 Local variable `_links` is marked as unused but is used
+ airflow/traces/otel_tracer.py:202:9: WPS121 Local variable `_links` is marked as unused but is used
+ airflow/utils/context.py:249:9: WPS121 Local variable `_asset_ref_names` is marked as unused but is used
+ airflow/utils/operator_helpers.py:121:9: WPS121 Local variable `_attr` is marked as unused but is used
+ airflow/utils/task_instance_session.py:41:13: WPS121 Local variable `__current_task_instance_session` is marked as unused but is used
+ airflow/utils/task_instance_session.py:49:9: WPS121 Local variable `__current_task_instance_session` is marked as unused but is used
+ airflow/utils/task_instance_session.py:64:5: WPS121 Local variable `__current_task_instance_session` is marked as unused but is used
+ airflow/utils/task_instance_session.py:68:9: WPS121 Local variable `__current_task_instance_session` is marked as unused but is used
+ airflow/www/auth.py:83:13: WPS121 Local variable `_permission_name` is marked as unused but is used
... 137 additional changes omitted for project

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

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

+ superset/connectors/sqla/models.py:461:17: WPS121 Local variable `_columns` is marked as unused but is used
+ superset/db_engine_specs/presto.py:149:13: WPS121 Local variable `_column` is marked as unused but is used
+ superset/migrations/versions/2018-11-12_13-31_4ce8df208545_migrate_time_range_for_default_filters.py:71:29: WPS121 Local variable `__from` is marked as unused but is used
+ superset/migrations/versions/2018-11-12_13-31_4ce8df208545_migrate_time_range_for_default_filters.py:72:29: WPS121 Local variable `__to` is marked as unused but is used
+ superset/models/helpers.py:1650:21: WPS121 Local variable `_sql` is marked as unused but is used
+ superset/models/helpers.py:1651:21: WPS121 Local variable `_column_label` is marked as unused but is used
+ superset/models/helpers.py:1898:25: WPS121 Local variable `_since` is marked as unused but is used
+ superset/models/helpers.py:1898:33: WPS121 Local variable `_until` is marked as unused but is used
+ superset/utils/date_parser.py:180:5: WPS121 Local variable `_relative_start` is marked as unused but is used
+ superset/utils/date_parser.py:181:5: WPS121 Local variable `_relative_end` is marked as unused but is used
... 29 additional changes omitted for project

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

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

+ examples/server/app/spectrogram/audio.py:59:13: WPS121 Local variable `_f_carrier` is marked as unused but is used
+ examples/server/app/spectrogram/audio.py:60:13: WPS121 Local variable `_f_mod` is marked as unused but is used
+ examples/server/app/spectrogram/audio.py:61:13: WPS121 Local variable `_ind_mod` is marked as unused but is used
+ src/bokeh/application/handlers/code_runner.py:219:9: WPS121 Local variable `_cwd` is marked as unused but is used
+ src/bokeh/application/handlers/code_runner.py:220:9: WPS121 Local variable `_sys_path` is marked as unused but is used
+ src/bokeh/application/handlers/code_runner.py:221:9: WPS121 Local variable `_sys_argv` is marked as unused but is used
+ src/bokeh/command/subcommands/static.py:79:9: WPS121 Local variable `_allowed_keys` is marked as unused but is used
+ src/bokeh/core/property/bases.py:450:9: WPS121 Local variable `_type_params` is marked as unused but is used
+ src/bokeh/io/notebook.py:484:5: WPS121 Local variable `_NOTEBOOK_LOADED` is marked as unused but is used
+ src/bokeh/io/state.py:232:9: WPS121 Local variable `_STATE` is marked as unused but is used
... 21 additional changes omitted for project

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

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

+ analytics/tests/test_counts.py:1035:9: WPS121 Local variable `_1day` is marked as unused but is used
+ analytics/tests/test_counts.py:1058:9: WPS121 Local variable `_15day` is marked as unused but is used
+ analytics/tests/test_counts.py:1108:9: WPS121 Local variable `_15day` is marked as unused but is used
+ analytics/tests/test_counts.py:985:9: WPS121 Local variable `_1day` is marked as unused but is used
+ corporate/lib/stripe.py:1819:17: WPS121 Local variable `_price_per_license` is marked as unused but is used
+ zerver/data_import/slack.py:496:5: WPS121 Local variable `_default_timezone` is marked as unused but is used
+ zerver/lib/import_realm.py:1081:13: WPS121 Local variable `_cache` is marked as unused but is used
+ zerver/lib/markdown/__init__.py:2674:5: WPS121 Local variable `_md_engine` is marked as unused but is used
+ zerver/lib/test_runner.py:200:9: WPS121 Local variable `_worker_id` is marked as unused but is used
+ zerver/lib/transfer.py:143:9: WPS121 Local variable `_cache` is marked as unused but is used
... 3 additional changes omitted for project

Changes by rule (1 rules affected)

code total + violation - violation + fix - fix
WPS121 253 253 0 0 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants