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-nested-blocks (PLR1702) #9172

Merged
merged 3 commits into from
Jan 24, 2024

Conversation

diceroll123
Copy link
Contributor

Summary

Implement PLR1702/too-many-nested-blocks

See: #970

Test Plan

cargo test

Copy link

codspeed-hq bot commented Dec 17, 2023

CodSpeed Performance Report

Merging #9172 will not alter performance

Comparing diceroll123:add-R1702 (d18e76d) with main (fc3e266)

Summary

✅ 30 untouched benchmarks

Copy link
Contributor

github-actions bot commented Dec 17, 2023

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

ℹ️ ecosystem check detected linter changes. (+95 -0 violations, +0 -0 fixes in 9 projects; 34 projects unchanged)

aiven/aiven-client (+1 -0 violations, +0 -0 fixes)

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

+ aiven/client/cli.py:847:9: PLR1702 Too many nested blocks (6 > 5)

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

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

+ airflow/jobs/backfill_job_runner.py:480:9: PLR1702 Too many nested blocks (6 > 5)
+ airflow/jobs/backfill_job_runner.py:480:9: PLR1702 Too many nested blocks (6 > 5)
+ airflow/jobs/backfill_job_runner.py:480:9: PLR1702 Too many nested blocks (6 > 5)
+ airflow/jobs/backfill_job_runner.py:480:9: PLR1702 Too many nested blocks (6 > 5)
+ airflow/jobs/backfill_job_runner.py:480:9: PLR1702 Too many nested blocks (7 > 5)
+ airflow/jobs/backfill_job_runner.py:480:9: PLR1702 Too many nested blocks (7 > 5)
+ airflow/jobs/backfill_job_runner.py:480:9: PLR1702 Too many nested blocks (7 > 5)
+ airflow/providers/cncf/kubernetes/utils/pod_manager.py:425:13: PLR1702 Too many nested blocks (7 > 5)
+ airflow/providers/cncf/kubernetes/utils/pod_manager.py:425:13: PLR1702 Too many nested blocks (7 > 5)
+ airflow/providers/databricks/operators/databricks.py:58:5: PLR1702 Too many nested blocks (6 > 5)
+ airflow/providers/databricks/operators/databricks.py:58:5: PLR1702 Too many nested blocks (7 > 5)
... 10 additional changes omitted for project

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

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

+ samcli/commands/sync/command.py:325:5: PLR1702 Too many nested blocks (7 > 5)
+ samcli/lib/package/utils.py:262:5: PLR1702 Too many nested blocks (7 > 5)
+ samcli/lib/utils/subprocess_utils.py:87:5: PLR1702 Too many nested blocks (6 > 5)
+ samcli/lib/utils/subprocess_utils.py:87:5: PLR1702 Too many nested blocks (6 > 5)

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

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

+ src/bokeh/core/query.py:178:5: PLR1702 Too many nested blocks (6 > 5)
+ src/bokeh/core/query.py:178:5: PLR1702 Too many nested blocks (6 > 5)
+ tests/unit/bokeh/command/subcommands/test_serve.py:508:5: PLR1702 Too many nested blocks (6 > 5)

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

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

+ admin/bootstrap.py:85:5: PLR1702 Too many nested blocks (6 > 5)
+ securedrop/pretty_bad_protocol/_parsers.py:294:9: PLR1702 Too many nested blocks (6 > 5)

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

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

+ ci/check_disallowed_imports.py:24:5: PLR1702 Too many nested blocks (6 > 5)
+ ibis/expr/visualize.py:105:5: PLR1702 Too many nested blocks (6 > 5)

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

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

+ pandas/core/dtypes/dtypes.py:1218:9: PLR1702 Too many nested blocks (6 > 5)
+ pandas/core/generic.py:7331:9: PLR1702 Too many nested blocks (6 > 5)
+ pandas/core/generic.py:7331:9: PLR1702 Too many nested blocks (6 > 5)
+ pandas/core/generic.py:7331:9: PLR1702 Too many nested blocks (7 > 5)
+ pandas/core/indexes/multi.py:3211:9: PLR1702 Too many nested blocks (6 > 5)
+ pandas/core/indexing.py:1828:9: PLR1702 Too many nested blocks (6 > 5)
+ pandas/core/indexing.py:1828:9: PLR1702 Too many nested blocks (7 > 5)
+ pandas/core/internals/array_manager.py:266:9: PLR1702 Too many nested blocks (6 > 5)
+ pandas/core/internals/construction.py:811:5: PLR1702 Too many nested blocks (6 > 5)
+ pandas/core/reshape/merge.py:1015:9: PLR1702 Too many nested blocks (6 > 5)
+ pandas/core/reshape/merge.py:1015:9: PLR1702 Too many nested blocks (6 > 5)
+ pandas/core/strings/accessor.py:281:9: PLR1702 Too many nested blocks (6 > 5)
+ pandas/core/tools/times.py:82:9: PLR1702 Too many nested blocks (6 > 5)
+ pandas/core/window/common.py:18:5: PLR1702 Too many nested blocks (6 > 5)
+ pandas/core/window/common.py:18:5: PLR1702 Too many nested blocks (6 > 5)
+ pandas/core/window/numba_.py:130:9: PLR1702 Too many nested blocks (7 > 5)
+ pandas/core/window/numba_.py:130:9: PLR1702 Too many nested blocks (8 > 5)
+ pandas/core/window/numba_.py:316:9: PLR1702 Too many nested blocks (7 > 5)
+ pandas/core/window/numba_.py:316:9: PLR1702 Too many nested blocks (8 > 5)
+ pandas/core/window/online.py:59:9: PLR1702 Too many nested blocks (6 > 5)
+ pandas/core/window/online.py:59:9: PLR1702 Too many nested blocks (6 > 5)
... 19 additional changes omitted for project

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

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

+ rotkehlchen/chain/ethereum/modules/convex/decoder.py:124:9: PLR1702 Too many nested blocks (6 > 5)
+ rotkehlchen/chain/evm/node_inquirer.py:937:9: PLR1702 Too many nested blocks (6 > 5)
+ rotkehlchen/chain/evm/node_inquirer.py:937:9: PLR1702 Too many nested blocks (6 > 5)
+ rotkehlchen/chain/evm/node_inquirer.py:937:9: PLR1702 Too many nested blocks (6 > 5)
+ rotkehlchen/externalapis/etherscan.py:242:9: PLR1702 Too many nested blocks (6 > 5)
+ rotkehlchen/tests/api/test_makerdao_dsr.py:502:5: PLR1702 Too many nested blocks (6 > 5)
+ rotkehlchen/tests/unit/test_tasks_manager.py:183:5: PLR1702 Too many nested blocks (6 > 5)
+ rotkehlchen/tests/utils/blockchain.py:223:9: PLR1702 Too many nested blocks (6 > 5)
+ rotkehlchen/tests/utils/blockchain.py:223:9: PLR1702 Too many nested blocks (6 > 5)
+ rotkehlchen/tests/utils/blockchain.py:223:9: PLR1702 Too many nested blocks (7 > 5)

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

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

+ scripts/setup/generate_secrets.py:128:5: PLR1702 Too many nested blocks (6 > 5)
+ zerver/lib/events.py:749:5: PLR1702 Too many nested blocks (6 > 5)
+ zerver/lib/events.py:749:5: PLR1702 Too many nested blocks (6 > 5)
+ zerver/lib/events.py:749:5: PLR1702 Too many nested blocks (6 > 5)
+ zerver/lib/events.py:749:5: PLR1702 Too many nested blocks (6 > 5)
+ zerver/lib/events.py:749:5: PLR1702 Too many nested blocks (6 > 5)
+ zerver/lib/events.py:749:5: PLR1702 Too many nested blocks (6 > 5)
+ zerver/lib/events.py:749:5: PLR1702 Too many nested blocks (7 > 5)
+ zerver/lib/events.py:749:5: PLR1702 Too many nested blocks (7 > 5)
+ zerver/lib/events.py:749:5: PLR1702 Too many nested blocks (7 > 5)
... 2 additional changes omitted for project

Changes by rule (1 rules affected)

code total + violation - violation + fix - fix
PLR1702 95 95 0 0 0

@diceroll123 diceroll123 changed the title [pylint] - implement PLR1702/too-many-nested-blocks [pylint] - implement PLR1702/too-many-nested-blocks Jan 20, 2024
@diceroll123 diceroll123 force-pushed the add-R1702 branch 4 times, most recently from a4446d5 to 7f4a5ad Compare January 20, 2024 23:18
@diceroll123 diceroll123 changed the title [pylint] - implement PLR1702/too-many-nested-blocks [pylint] - implement too-many-nested-blocks (PLR1702) Jan 21, 2024
Copy link
Member

@charliermarsh charliermarsh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx!

@charliermarsh charliermarsh added rule Implementing or modifying a lint rule preview Related to preview mode features labels Jan 24, 2024
@charliermarsh charliermarsh enabled auto-merge (squash) January 24, 2024 19:24
@charliermarsh charliermarsh changed the title [pylint] - implement too-many-nested-blocks (PLR1702) [pylint] Implement too-many-nested-blocks (PLR1702) Jan 24, 2024
@charliermarsh charliermarsh enabled auto-merge (squash) January 24, 2024 19:25
@charliermarsh charliermarsh merged commit dba2cb7 into astral-sh:main Jan 24, 2024
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