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

[pylint] Implement too-many-locals (PLR0914) #9163

Merged
merged 6 commits into from
Dec 18, 2023

Conversation

diceroll123
Copy link
Contributor

@diceroll123 diceroll123 commented Dec 16, 2023

Summary

Implements PLR0914 - too-many-locals

See #970

Test Plan

cargo test

@diceroll123 diceroll123 force-pushed the add-PLR0914 branch 2 times, most recently from 341e669 to 62df5a2 Compare December 16, 2023 15:28
Copy link
Contributor

github-actions bot commented Dec 16, 2023

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

ℹ️ ecosystem check detected linter changes. (+366 -1 violations, +0 -0 fixes in 12 projects; 29 projects unchanged)

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

ruff check --no-cache --exit-zero --preview --select ALL

+ airflow/cli/commands/kubernetes_command.py:77:5: PLR0914 Too many local variables: (17/15)
+ airflow/dag_processing/processor.py:420:9: PLR0914 Too many local variables: (21/15)
+ airflow/io/path.py:93:9: PLR0914 Too many local variables: (16/15)
+ airflow/jobs/backfill_job_runner.py:854:9: PLR0914 Too many local variables: (16/15)
+ airflow/jobs/scheduler_job_runner.py:294:9: PLR0914 Too many local variables: (35/15)
+ airflow/jobs/scheduler_job_runner.py:683:9: PLR0914 Too many local variables: (16/15)
+ airflow/models/dag.py:1780:9: PLR0914 Too many local variables: (21/15)
+ airflow/models/dag.py:3017:9: PLR0914 Too many local variables: (36/15)
+ airflow/providers/dbt/cloud/utils/openlineage.py:31:5: PLR0914 Too many local variables: (19/15)
+ airflow/providers/google/cloud/hooks/bigquery.py:2024:9: PLR0914 Too many local variables: (16/15)
... 27 additional changes omitted for project

aws/aws-sam-cli (+20 -0 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --preview

+ samcli/commands/deploy/guided_context.py:108:9: PLR0914 Too many local variables: (20/15)
+ samcli/commands/init/interactive_init_flow.py:213:5: PLR0914 Too many local variables: (29/15)
+ samcli/commands/pipeline/bootstrap/cli.py:240:5: PLR0914 Too many local variables: (23/15)
+ samcli/hook_packages/terraform/hooks/prepare/translate.py:153:5: PLR0914 Too many local variables: (31/15)
+ samcli/lib/iac/cfn/cfn_iac.py:83:9: PLR0914 Too many local variables: (21/15)
+ samcli/lib/sync/infra_sync_executor.py:220:9: PLR0914 Too many local variables: (16/15)
+ samcli/local/apigw/local_apigw_service.py:623:9: PLR0914 Too many local variables: (16/15)
+ tests/unit/commands/buildcmd/test_build_context.py:407:9: PLR0914 Too many local variables: (24/15)
+ tests/unit/commands/buildcmd/test_build_context.py:664:9: PLR0914 Too many local variables: (16/15)
+ tests/unit/commands/buildcmd/test_build_context.py:922:9: PLR0914 Too many local variables: (18/15)
... 10 additional changes omitted for project

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

ruff check --no-cache --exit-zero --preview --select ALL

+ examples/advanced/extensions/parallel_plot/parallel_plot.py:14:5: PLR0914 Too many local variables: (24/15)
+ examples/models/calendars.py:26:5: PLR0914 Too many local variables: (21/15)
+ src/bokeh/embed/bundle.py:259:5: PLR0914 Too many local variables: (25/15)
+ src/bokeh/layouts.py:193:5: PLR0914 Too many local variables: (22/15)
+ src/bokeh/models/util/structure.py:226:9: PLR0914 Too many local variables: (18/15)
+ src/bokeh/plotting/_graph.py:54:5: PLR0914 Too many local variables: (30/15)
+ src/bokeh/plotting/_renderer.py:76:5: PLR0914 Too many local variables: (16/15)
+ tests/unit/bokeh/core/test_serialization.py:348:9: PLR0914 Too many local variables: (23/15)
+ tests/unit/bokeh/model/test_util_model.py:77:5: PLR0914 Too many local variables: (21/15)
+ tests/unit/bokeh/protocol/messages/test_patch_doc.py:107:9: PLR0914 Too many local variables: (19/15)
... 2 additional changes omitted for project

freedomofpress/securedrop (+7 -0 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --preview

+ securedrop/sdconfig.py:101:5: PLR0914 Too many local variables: (20/15)
+ securedrop/tests/functional/conftest.py:95:5: PLR0914 Too many local variables: (18/15)
+ securedrop/tests/test_integration.py:120:5: PLR0914 Too many local variables: (18/15)
+ securedrop/tests/test_integration.py:220:5: PLR0914 Too many local variables: (16/15)
+ securedrop/tests/test_journalist.py:3347:5: PLR0914 Too many local variables: (17/15)
+ securedrop/tests/test_journalist.py:3422:5: PLR0914 Too many local variables: (17/15)
+ securedrop/tests/utils/db_helper.py:164:5: PLR0914 Too many local variables: (16/15)

fronzbot/blinkpy (+1 -0 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --preview

+ blinkpy/sync_module.py:282:15: PLR0914 Too many local variables: (18/15)

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

ruff check --no-cache --exit-zero --preview

+ ibis/backends/bigquery/udf/core.py:524:9: PLR0914 Too many local variables: (17/15)
+ ibis/backends/dask/aggcontext.py:90:9: PLR0914 Too many local variables: (19/15)
+ ibis/backends/pandas/aggcontext.py:582:9: PLR0914 Too many local variables: (18/15)
+ ibis/backends/pandas/execution/window.py:258:5: PLR0914 Too many local variables: (16/15)
+ ibis/expr/datatypes/parse.py:54:5: PLR0914 Too many local variables: (20/15)

pandas-dev/pandas (+90 -0 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --preview

+ pandas/_version.py:250:5: PLR0914 Too many local variables: (17/15)
+ pandas/core/_numba/kernels/sum_.py:65:5: PLR0914 Too many local variables: (16/15)
+ pandas/core/_numba/kernels/var_.py:171:5: PLR0914 Too many local variables: (16/15)
+ pandas/core/_numba/kernels/var_.py:74:5: PLR0914 Too many local variables: (16/15)
+ pandas/core/arraylike.py:253:5: PLR0914 Too many local variables: (16/15)
+ pandas/core/arrays/datetimes.py:403:9: PLR0914 Too many local variables: (16/15)
+ pandas/core/computation/align.py:87:5: PLR0914 Too many local variables: (20/15)
+ pandas/core/frame.py:11370:9: PLR0914 Too many local variables: (17/15)
+ pandas/core/frame.py:11983:9: PLR0914 Too many local variables: (16/15)
+ pandas/core/frame.py:2264:9: PLR0914 Too many local variables: (16/15)
+ pandas/core/frame.py:6178:9: PLR0914 Too many local variables: (16/15)
+ pandas/core/frame.py:8547:9: PLR0914 Too many local variables: (16/15)
... 78 additional changes omitted for project

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

ruff check --no-cache --exit-zero --preview

+ src/pip/_internal/cli/autocompletion.py:15:5: PLR0914 Too many local variables: (19/15)
+ src/pip/_internal/commands/install.py:266:9: PLR0914 Too many local variables: (35/15)
+ src/pip/_internal/operations/install/wheel.py:426:5: PLR0914 Too many local variables: (38/15)

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

ruff check --no-cache --exit-zero --preview

+ package.py:583:9: PLR0914 Too many local variables: (21/15)
+ rotkehlchen/api/rest.py:3454:9: PLR0914 Too many local variables: (16/15)
+ rotkehlchen/api/rest.py:4044:9: PLR0914 Too many local variables: (16/15)
+ rotkehlchen/chain/ethereum/modules/balancer/balancer.py:570:9: PLR0914 Too many local variables: (18/15)
+ rotkehlchen/chain/ethereum/modules/balancer/utils.py:166:5: PLR0914 Too many local variables: (25/15)
+ rotkehlchen/chain/ethereum/modules/balancer/utils.py:44:5: PLR0914 Too many local variables: (20/15)
+ rotkehlchen/chain/ethereum/modules/curve/curve_cache.py:345:5: PLR0914 Too many local variables: (17/15)
+ rotkehlchen/chain/ethereum/modules/curve/decoder.py:380:9: PLR0914 Too many local variables: (16/15)
+ rotkehlchen/chain/ethereum/modules/liquity/trove.py:84:9: PLR0914 Too many local variables: (19/15)
+ rotkehlchen/chain/ethereum/modules/makerdao/dsr.py:217:9: PLR0914 Too many local variables: (24/15)
... 55 additional changes omitted for project

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

ruff check --no-cache --exit-zero --preview

+ src/scikit_build_core/build/sdist.py:91:5: PLR0914 Too many local variables: (16/15)
+ src/scikit_build_core/build/wheel.py:113:5: PLR0914 Too many local variables: (37/15)
+ src/scikit_build_core/setuptools/build_cmake.py:87:9: PLR0914 Too many local variables: (17/15)

sphinx-doc/sphinx (+12 -0 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --preview

+ sphinx/builders/changes.py:47:9: PLR0914 Too many local variables: (18/15)
+ sphinx/directives/other.py:86:9: PLR0914 Too many local variables: (17/15)
+ sphinx/domains/cpp.py:7696:9: PLR0914 Too many local variables: (17/15)
+ sphinx/domains/cpp.py:8014:9: PLR0914 Too many local variables: (28/15)
+ sphinx/domains/python.py:714:9: PLR0914 Too many local variables: (22/15)
+ sphinx/environment/adapters/indexentries.py:27:9: PLR0914 Too many local variables: (18/15)
+ sphinx/environment/collectors/toctree.py:64:13: PLR0914 Too many local variables: (17/15)
+ sphinx/ext/autosummary/generate.py:461:5: PLR0914 Too many local variables: (18/15)
+ sphinx/ext/autosummary/generate.py:590:5: PLR0914 Too many local variables: (16/15)
+ sphinx/ext/graphviz.py:221:5: PLR0914 Too many local variables: (16/15)
... 2 additional changes omitted for project

zulip/zulip (+111 -1 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --preview --select ALL

+ analytics/management/commands/populate_analytics_db.py:73:9: PLR0914 Too many local variables: (26/15)
+ analytics/views/installation_activity.py:94:5: PLR0914 Too many local variables: (16/15)
+ analytics/views/stats.py:250:5: PLR0914 Too many local variables: (17/15)
+ analytics/views/support.py:152:5: PLR0914 Too many local variables: (27/15)
+ analytics/views/support.py:395:5: PLR0914 Too many local variables: (18/15)
+ corporate/lib/stripe.py:1151:9: PLR0914 Too many local variables: (18/15)
+ corporate/lib/stripe.py:1325:9: PLR0914 Too many local variables: (16/15)
+ corporate/lib/stripe.py:1680:9: PLR0914 Too many local variables: (23/15)
... 103 additional changes omitted for rule PLR0914
+ zerver/lib/test_helpers.py:753:5: D400 First line should end with a period
- zerver/lib/test_helpers.py:753:5: D400 First line should end with a period
... 102 additional changes omitted for project

Changes by rule (2 rules affected)

code total + violation - violation + fix - fix
PLR0914 365 365 0 0 0
D400 2 1 1 0 0

@diceroll123 diceroll123 force-pushed the add-PLR0914 branch 2 times, most recently from 1eb9ba3 to 8ec4d43 Compare December 16, 2023 18:26
@diceroll123 diceroll123 force-pushed the add-PLR0914 branch 2 times, most recently from daaacd3 to c017e65 Compare December 17, 2023 04:25
@charliermarsh charliermarsh added rule Implementing or modifying a lint rule preview Related to preview mode features labels Dec 18, 2023
@charliermarsh charliermarsh changed the title [pylint] implement rule PLR0914 [pylint] Implement too-many-locals (PLR0914) Dec 18, 2023
@charliermarsh charliermarsh enabled auto-merge (squash) December 18, 2023 19:54
@charliermarsh charliermarsh merged commit 7c89492 into astral-sh:main Dec 18, 2023
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
preview Related to preview mode features rule Implementing or modifying a lint rule
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants