Skip to content

Comments

Re-code unnecessary-dict-comprehension-for-iterable (RUF025) as C420#12533

Merged
MichaReiser merged 1 commit intoruff-0.6from
charlie/c420
Aug 12, 2024
Merged

Re-code unnecessary-dict-comprehension-for-iterable (RUF025) as C420#12533
MichaReiser merged 1 commit intoruff-0.6from
charlie/c420

Conversation

@charliermarsh
Copy link
Member

Summary

Closes #12110.

@charliermarsh charliermarsh added this to the v0.6 milestone Jul 26, 2024
@charliermarsh charliermarsh added the rule Implementing or modifying a lint rule label Jul 26, 2024
@github-actions
Copy link
Contributor

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

ℹ️ ecosystem check detected linter changes. (+19 -19 violations, +0 -0 fixes in 15 projects; 39 projects unchanged)

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

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

+ disnake/ext/commands/flag_converter.py:314:28: C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead
- disnake/ext/commands/flag_converter.py:314:28: RUF025 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead

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

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

- rasa/core/evaluation/marker_stats.py:114:51: RUF025 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead
- rasa/core/featurizers/single_state_featurizer.py:119:20: RUF025 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead
- tests/core/featurizers/test_precomputation.py:110:17: RUF025 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead

PlasmaPy/PlasmaPy (+1 -0 violations, +0 -0 fixes)

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

+ src/plasmapy/particles/ionization_state_collection.py:693:40: C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead

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

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

+ helm_tests/airflow_aux/test_annotations.py:409:63: C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead
- helm_tests/airflow_aux/test_annotations.py:409:63: RUF025 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead
+ tests/ti_deps/deps/test_mapped_task_upstream_dep.py:459:36: C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead
- tests/ti_deps/deps/test_mapped_task_upstream_dep.py:459:36: RUF025 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead

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

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

+ superset/reports/notifications/email.py:58:28: C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead
- superset/reports/notifications/email.py:58:28: RUF025 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead
+ superset/reports/notifications/slack_mixin.py:107:43: C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead
- superset/reports/notifications/slack_mixin.py:107:43: RUF025 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead
+ superset/reports/notifications/slack_mixin.py:97:39: C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead
- superset/reports/notifications/slack_mixin.py:97:39: RUF025 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead

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

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

+ src/bokeh/command/subcommands/file_output.py:145:17: C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead
- src/bokeh/command/subcommands/file_output.py:145:17: RUF025 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead
+ src/bokeh/command/subcommands/serve.py:831:17: C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead
- src/bokeh/command/subcommands/serve.py:831:17: RUF025 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead

docker/docker-py (+1 -0 violations, +0 -0 fixes)

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

+ docker/types/containers.py:725:22: C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead

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

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

+ ibis/common/egraph.py:776:17: C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead
- ibis/common/egraph.py:776:17: RUF025 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead

mlflow/mlflow (+1 -0 violations, +0 -0 fixes)

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

+ tests/metrics/genai/test_genai_metrics.py:554:37: C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead

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

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

+ src/build/__main__.py:40:14: C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead
- src/build/__main__.py:40:14: RUF025 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead

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

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

+ src/pip/_internal/locations/_sysconfig.py:164:21: C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead
+ src/pip/_internal/locations/_sysconfig.py:166:21: C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead

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

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

+ skbuild/setuptools_wrap.py:516:22: C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead
- skbuild/setuptools_wrap.py:516:22: RUF025 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead
+ skbuild/setuptools_wrap.py:519:19: C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead
- skbuild/setuptools_wrap.py:519:19: RUF025 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead

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

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

+ src/scikit_build_core/_logging.py:118:14: C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead
- src/scikit_build_core/_logging.py:118:14: RUF025 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead

pytest-dev/pytest (+0 -3 violations, +0 -0 fixes)

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

- src/_pytest/logging.py:128:24: RUF025 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead
- src/_pytest/reports.py:345:20: RUF025 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead
- testing/conftest.py:191:21: RUF025 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead

mesonbuild/meson-python (+1 -0 violations, +0 -0 fixes)

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

+ mesonpy/__init__.py:570:24: C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead

Changes by rule (2 rules affected)

code total + violation - violation + fix - fix
C420 19 19 0 0 0
RUF025 19 0 19 0 0

Copy link
Contributor

@Skylion007 Skylion007 left a comment

Choose a reason for hiding this comment

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

LGTM

@MichaReiser MichaReiser added the breaking Breaking API change label Jul 29, 2024
@MichaReiser MichaReiser changed the base branch from main to ruff-0.6 August 12, 2024 09:26
@MichaReiser MichaReiser merged commit 4ec340a into ruff-0.6 Aug 12, 2024
@MichaReiser MichaReiser deleted the charlie/c420 branch August 12, 2024 09:27
@MichaReiser MichaReiser mentioned this pull request Aug 13, 2024
AlexWaygood pushed a commit that referenced this pull request Aug 14, 2024
MichaReiser pushed a commit that referenced this pull request Aug 14, 2024
MichaReiser pushed a commit that referenced this pull request Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking Breaking API change rule Implementing or modifying a lint rule

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RUF025 duplicates unimplemented rule C420

3 participants