-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[flake8-builtins
] Skip lambda expressions in builtin-argument-shadowing (A002)
#14144
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
code | total | + violation | - violation | + fix | - fix |
---|---|---|---|---|---|
A002 | 554 | 276 | 278 | 0 | 0 |
Linter (preview)
ℹ️ ecosystem check detected linter changes. (+276 -278 violations, +0 -0 fixes in 6 projects; 48 projects unchanged)
apache/airflow (+79 -79 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview --select ALL
- airflow/cli/cli_config.py:82:9: A002 Argument `help` is shadowing a Python builtin + airflow/cli/cli_config.py:82:9: A002 Function argument `help` is shadowing a Python builtin - airflow/cli/cli_config.py:86:9: A002 Argument `type` is shadowing a Python builtin + airflow/cli/cli_config.py:86:9: A002 Function argument `type` is shadowing a Python builtin - airflow/models/pool.py:96:25: A002 Argument `id` is shadowing a Python builtin + airflow/models/pool.py:96:25: A002 Function argument `id` is shadowing a Python builtin - airflow/models/taskinstance.py:229:26: A002 Argument `id` is shadowing a Python builtin + airflow/models/taskinstance.py:229:26: A002 Function argument `id` is shadowing a Python builtin - airflow/traces/tracer.py:38:28: A002 Argument `list` is shadowing a Python builtin + airflow/traces/tracer.py:38:28: A002 Function argument `list` is shadowing a Python builtin - airflow/traces/utils.py:36:53: A002 Argument `type` is shadowing a Python builtin + airflow/traces/utils.py:36:53: A002 Function argument `type` is shadowing a Python builtin - dev/assign_cherry_picked_prs_with_milestone.py:381:27: A002 Argument `type` is shadowing a Python builtin + dev/assign_cherry_picked_prs_with_milestone.py:381:27: A002 Function argument `type` is shadowing a Python builtin ... 144 additional changes omitted for project
apache/superset (+12 -13 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview --select ALL
- superset/migrations/versions/2018-07-22_11-59_bebcf3fed1fe_convert_dashboard_v1_positions.py:228:27: A002 Argument `sum` is shadowing a Python builtin - superset/models/helpers.py:1429:9: A002 Argument `filter` is shadowing a Python builtin + superset/models/helpers.py:1429:9: A002 Function argument `filter` is shadowing a Python builtin - superset/utils/core.py:590:15: A002 Argument `type` is shadowing a Python builtin + superset/utils/core.py:590:15: A002 Function argument `type` is shadowing a Python builtin - superset/utils/core.py:609:15: A002 Argument `type` is shadowing a Python builtin + superset/utils/core.py:609:15: A002 Function argument `type` is shadowing a Python builtin - tests/integration_tests/base_tests.py:598:9: A002 Argument `filter` is shadowing a Python builtin + tests/integration_tests/base_tests.py:598:9: A002 Function argument `filter` is shadowing a Python builtin - tests/integration_tests/celery_tests.py:64:21: A002 Argument `id` is shadowing a Python builtin ... 15 additional changes omitted for project
bokeh/bokeh (+117 -117 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview --select ALL
- src/bokeh/core/property/alias.py:83:46: A002 Argument `help` is shadowing a Python builtin + src/bokeh/core/property/alias.py:83:46: A002 Function argument `help` is shadowing a Python builtin - src/bokeh/core/property/alias.py:98:39: A002 Argument `help` is shadowing a Python builtin + src/bokeh/core/property/alias.py:98:39: A002 Function argument `help` is shadowing a Python builtin - src/bokeh/core/property/any.py:83:58: A002 Argument `help` is shadowing a Python builtin + src/bokeh/core/property/any.py:83:58: A002 Function argument `help` is shadowing a Python builtin - src/bokeh/core/property/bases.py:110:57: A002 Argument `help` is shadowing a Python builtin + src/bokeh/core/property/bases.py:110:57: A002 Function argument `help` is shadowing a Python builtin - src/bokeh/core/property/bases.py:139:57: A002 Argument `help` is shadowing a Python builtin + src/bokeh/core/property/bases.py:139:57: A002 Function argument `help` is shadowing a Python builtin - src/bokeh/core/property/bases.py:449:93: A002 Argument `help` is shadowing a Python builtin + src/bokeh/core/property/bases.py:449:93: A002 Function argument `help` is shadowing a Python builtin - src/bokeh/core/property/bases.py:460:57: A002 Argument `help` is shadowing a Python builtin + src/bokeh/core/property/bases.py:460:57: A002 Function argument `help` is shadowing a Python builtin - src/bokeh/core/property/bases.py:516:96: A002 Argument `help` is shadowing a Python builtin + src/bokeh/core/property/bases.py:516:96: A002 Function argument `help` is shadowing a Python builtin - src/bokeh/core/property/color.py:124:112: A002 Argument `help` is shadowing a Python builtin + src/bokeh/core/property/color.py:124:112: A002 Function argument `help` is shadowing a Python builtin - src/bokeh/core/property/color.py:176:55: A002 Argument `help` is shadowing a Python builtin + src/bokeh/core/property/color.py:176:55: A002 Function argument `help` is shadowing a Python builtin - src/bokeh/core/property/constraints.py:60:9: A002 Argument `type` is shadowing a Python builtin ... 213 additional changes omitted for project
zulip/zulip (+52 -53 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview --select ALL
- analytics/lib/counts.py:418:25: A002 Argument `property` is shadowing a Python builtin + analytics/lib/counts.py:418:25: A002 Function argument `property` is shadowing a Python builtin - analytics/lib/counts.py:432:5: A002 Argument `property` is shadowing a Python builtin + analytics/lib/counts.py:432:5: A002 Function argument `property` is shadowing a Python builtin - analytics/lib/counts.py:475:9: A002 Argument `property` is shadowing a Python builtin + analytics/lib/counts.py:475:9: A002 Function argument `property` is shadowing a Python builtin - analytics/lib/counts.py:523:5: A002 Argument `property` is shadowing a Python builtin + analytics/lib/counts.py:523:5: A002 Function argument `property` is shadowing a Python builtin - analytics/lib/counts.py:57:9: A002 Argument `property` is shadowing a Python builtin + analytics/lib/counts.py:57:9: A002 Function argument `property` is shadowing a Python builtin ... 95 additional changes omitted for project
zanieb/huggingface-notebooks (+8 -8 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview --select A,E703,F704,B015,B018,D100
- course/fr/chapter9/section4.ipynb:cell 5:17:13: A002 Argument `input` is shadowing a Python builtin + course/fr/chapter9/section4.ipynb:cell 5:17:13: A002 Function argument `input` is shadowing a Python builtin - diffusers/exploring_simple optimizations_for_sdxl.ipynb:cell 6:10:25: A002 Argument `bytes` is shadowing a Python builtin + diffusers/exploring_simple optimizations_for_sdxl.ipynb:cell 6:10:25: A002 Function argument `bytes` is shadowing a Python builtin - diffusers/in_painting_with_stable_diffusion_using_diffusers.ipynb:cell 15:1:13: A002 Argument `dict` is shadowing a Python builtin + diffusers/in_painting_with_stable_diffusion_using_diffusers.ipynb:cell 15:1:13: A002 Function argument `dict` is shadowing a Python builtin - diffusers/sd_textual_inversion_training.ipynb:cell 22:12:9: A002 Argument `set` is shadowing a Python builtin + diffusers/sd_textual_inversion_training.ipynb:cell 22:12:9: A002 Function argument `set` is shadowing a Python builtin - diffusers/stable_diffusion_textual_inversion_library_navigator.ipynb:cell 7:6:24: A002 Argument `id` is shadowing a Python builtin + diffusers/stable_diffusion_textual_inversion_library_navigator.ipynb:cell 7:6:24: A002 Function argument `id` is shadowing a Python builtin ... 6 additional changes omitted for project
openai/openai-cookbook (+8 -8 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview --select A,E703,F704,B015,B018,D100
- examples/Custom-LLM-as-a-Judge.ipynb:cell 13:21:25: A002 Argument `input` is shadowing a Python builtin + examples/Custom-LLM-as-a-Judge.ipynb:cell 13:21:25: A002 Function argument `input` is shadowing a Python builtin - examples/Custom-LLM-as-a-Judge.ipynb:cell 15:13:16: A002 Argument `input` is shadowing a Python builtin + examples/Custom-LLM-as-a-Judge.ipynb:cell 15:13:16: A002 Function argument `input` is shadowing a Python builtin - examples/Custom-LLM-as-a-Judge.ipynb:cell 18:2:25: A002 Argument `input` is shadowing a Python builtin + examples/Custom-LLM-as-a-Judge.ipynb:cell 18:2:25: A002 Function argument `input` is shadowing a Python builtin - examples/Custom-LLM-as-a-Judge.ipynb:cell 23:37:22: A002 Argument `input` is shadowing a Python builtin + examples/Custom-LLM-as-a-Judge.ipynb:cell 23:37:22: A002 Function argument `input` is shadowing a Python builtin - examples/Custom-LLM-as-a-Judge.ipynb:cell 24:1:16: A002 Argument `input` is shadowing a Python builtin + examples/Custom-LLM-as-a-Judge.ipynb:cell 24:1:16: A002 Function argument `input` is shadowing a Python builtin ... 6 additional changes omitted for project
Changes by rule (1 rules affected)
code | total | + violation | - violation | + fix | - fix |
---|---|---|---|---|---|
A002 | 554 | 276 | 278 | 0 | 0 |
dhruvmanila
approved these changes
Nov 7, 2024
Should we update the diagnostic message to be more explicit similar to |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Flake8-builtins provides two checks for arguments (really, parameters) of a function shadowing builtins: A002 checks function definitions, and A006 checks lambda expressions. This PR ensures that A002 is restricted to functions rather than lambda expressions.
Closes #14135 .