Skip to content

Conversation

@ntBre
Copy link
Contributor

@ntBre ntBre commented Mar 11, 2025

Summary

Stabilizes C420 for the 0.10 release.

Test Plan

No open issues or PRs (except a general issue about string normalization). The last (and only) false-negative bug fix was over a month ago.

The tests for this rule were already not on the preview_rules test, so I just changed the RuleGroup. The documentation looked okay to me.

@ntBre ntBre added the rule Implementing or modifying a lint rule label Mar 11, 2025
@ntBre ntBre added this to the v0.10 milestone Mar 11, 2025
@github-actions
Copy link
Contributor

ruff-ecosystem results

Linter (stable)

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

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

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

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

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

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

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

+ airflow/api_fastapi/core_api/services/ui/dependencies.py:39:32: C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead
+ helm_tests/airflow_aux/test_annotations.py:409:63: C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead
+ tests/ti_deps/deps/test_mapped_task_upstream_dep.py:442:36: C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead

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

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

+ superset/reports/notifications/email.py:60:28: C420 [*] 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:97:39: C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead

binary-husky/gpt_academic (+1 -0 violations, +0 -0 fixes)

+ multi_language.py:262:21: C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead

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

ruff check --no-cache --exit-zero --ignore RUF9 --no-fix --output-format concise --no-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/serve.py:831:17: C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead

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

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

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

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

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

+ mlflow/models/evaluation/base.py:880:32: C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead
+ tests/evaluate/test_default_evaluator.py:134:28: C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead
+ tests/metrics/genai/test_genai_metrics.py:559:37: C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead

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

+ asv_bench/benchmarks/frame_methods.py:520:30: C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead
+ pandas/core/apply.py:226:24: C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead
+ pandas/core/generic.py:9707:21: C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead
+ pandas/core/groupby/groupby.py:5178:42: C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead
+ pandas/io/formats/format.py:569:27: C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead
+ pandas/io/formats/style_render.py:1228:25: C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead
+ pandas/io/formats/style_render.py:1414:25: C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead
+ pandas/io/formats/style_render.py:1711:25: C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead
+ pandas/io/sql.py:1904:25: C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead
+ pandas/io/sql.py:2862:25: C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead
+ pandas/tests/apply/test_frame_apply.py:278:26: C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead
+ pandas/tests/apply/test_frame_apply.py:305:9: C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead
... 2 additional changes omitted for project

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

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

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

+ 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

python-poetry/poetry (+1 -0 violations, +0 -0 fixes)

+ src/poetry/console/commands/update.py:46:38: C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead

reflex-dev/reflex (+5 -0 violations, +0 -0 fixes)

+ reflex/compiler/compiler.py:308:21: C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead
+ reflex/compiler/compiler.py:313:17: C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead
+ reflex/components/dynamic.py:76:17: C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead
+ reflex/components/dynamic.py:81:13: C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead
+ reflex/vars/base.py:163:21: C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead

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

+ skbuild/setuptools_wrap.py:517:22: C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead
+ skbuild/setuptools_wrap.py:520:19: C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead

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

+ src/scikit_build_core/format.py:74:16: C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead

wntrblm/nox (+1 -0 violations, +0 -0 fixes)

+ nox/virtualenv.py:165:23: C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead

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

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

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

+ astropy/coordinates/representation/base.py:966:20: C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead
+ astropy/coordinates/transformations/graph.py:292:22: C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead
+ astropy/coordinates/transformations/graph.py:478:22: C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead
+ astropy/coordinates/transformations/graph.py:479:18: C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead
+ astropy/modeling/core.py:830:40: C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead
+ astropy/modeling/core.py:835:53: C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead
+ astropy/modeling/core.py:850:20: C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead
+ astropy/modeling/core.py:864:20: C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead
+ astropy/modeling/mappings.py:66:36: C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead
+ astropy/modeling/mappings.py:67:49: C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead
+ astropy/modeling/tabular.py:175:16: C420 [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead
... 2 additional changes omitted for project

Changes by rule (1 rules affected)

code total + violation - violation + fix - fix
C420 57 57 0 0 0

Linter (preview)

✅ ecosystem check detected no linter changes.

@ntBre
Copy link
Contributor Author

ntBre commented Mar 11, 2025

All of the ecosystem results look like true positives to me.

@ntBre ntBre merged commit f1afd6e into micha/ruff-0.10 Mar 11, 2025
21 checks passed
@ntBre ntBre deleted the brent/0.10-c420 branch March 11, 2025 14:59
@ntBre ntBre mentioned this pull request Mar 11, 2025
2 tasks
MichaReiser pushed a commit that referenced this pull request Mar 13, 2025
…or-iterable` (`C420`) (#16624)

## Summary

Stabilizes C420 for the 0.10 release.

## Test Plan

No open issues or PRs (except a general issue about [string
normalization](#16579)). The
last (and only) false-negative bug fix was over a month ago.

The tests for this rule were already not on the `preview_rules` test, so
I just changed the `RuleGroup`. The documentation looked okay to me.
MichaReiser pushed a commit that referenced this pull request Mar 13, 2025
…or-iterable` (`C420`) (#16624)

## Summary

Stabilizes C420 for the 0.10 release.

## Test Plan

No open issues or PRs (except a general issue about [string
normalization](#16579)). The
last (and only) false-negative bug fix was over a month ago.

The tests for this rule were already not on the `preview_rules` test, so
I just changed the `RuleGroup`. The documentation looked okay to me.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rule Implementing or modifying a lint rule

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants