Skip to content

Update preview default rules and categories - #27877

Merged
ntBre merged 8 commits into
brent/rule-acceptance-guidelinesfrom
brent/update-preview-category-defaults
Aug 27, 2026
Merged

ntBre merged 8 commits into
brent/rule-acceptance-guidelinesfrom
brent/update-preview-category-defaults

Conversation

@ntBre

@ntBre ntBre commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Summary

These are the last five commits from #27666 that update the preview default selectors based on the new categorization:

  • add current preview rules to the default selectors
  • add third-party rules to the default selectors
  • add preview rules stabilized in 0.15 to the default selectors (oops)
  • incorporate the DTZ and F406 changes from Feedback on new default rules #27213
  • adjust 4 categories that genuinely differ between my previous and current categorizations

Test Plan

Updated default rules snapshot

@ntBre ntBre added preview Related to preview-mode features rule-selection Related to enabling or disabling rules labels Aug 19, 2026
@astral-sh-bot

astral-sh-bot Bot commented Aug 19, 2026 •

Copy link
Copy Markdown

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

ℹ️ ecosystem check detected linter changes. (+1245 -125 violations, +0 -0 fixes in 14 projects; 45 projects unchanged)

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

ruff check --no-cache --exit-zero --no-fix --output-format concise --preview

+ aiven/client/argx.py:199:14: subclass-builtin Subclassing `dict` can be error prone, use `collections.UserDict` instead
+ aiven/client/argx.py:74:22: if-exp-instead-of-or-operator [*] Replace ternary `if` expression with `or` operator
+ aiven/client/cli.py:4501:46: unnecessary-dict-comprehension-for-iterable [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead
+ aiven/client/cli.py:6654:34: unnecessary-dict-comprehension-for-iterable [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead
+ aiven/client/cli.py:6765:34: unnecessary-dict-comprehension-for-iterable [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead
+ aiven/client/client.py:142:54: if-exp-instead-of-or-operator [*] Replace ternary `if` expression with `or` operator
+ aiven/client/client.py:856:20: if-exp-instead-of-or-operator [*] Replace ternary `if` expression with `or` operator
+ aiven/client/client.py:880:20: if-exp-instead-of-or-operator [*] Replace ternary `if` expression with `or` operator
+ aiven/client/connection_info/_utils.py:47:13: repeated-append Use `bits.extend((":", urllib.parse.quote(password)))` instead of repeatedly calling `bits.append()`
+ tests/test_cli.py:1505:5: pytest-raises-with-multiple-statements `pytest.raises()` block should contain a single simple statement
... 3 additional changes omitted for project

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

ruff check --no-cache --exit-zero --no-fix --output-format concise --preview

+ docs/_author_list_from_cff.py:97:9: missing-f-string-syntax Possible f-string without an `f` prefix
+ docs/notebooks/formulary/ExB_drift.ipynb:cell 15:3:24: missing-f-string-syntax Possible f-string without an `f` prefix
+ docs/notebooks/formulary/ExB_drift.ipynb:cell 15:4:30: missing-f-string-syntax Possible f-string without an `f` prefix
+ src/plasmapy/analysis/fit_functions.py:584:12: float-equality-comparison Unreliable floating point equality comparison `m == 0.0`
+ src/plasmapy/analysis/swept_langmuir/floating_potential.py:243:17: float-equality-comparison Unreliable floating point equality comparison `current == 0.0`
+ src/plasmapy/formulary/quantum.py:123:10: float-equality-comparison Unreliable floating point equality comparison `0 * u.m / u.s == V`
+ src/plasmapy/plasma/grids.py:1373:26: float-equality-comparison Unreliable floating point equality comparison `norms == 0.0`
+ tests/analysis/test_fit_functions.py:534:16: float-equality-comparison Unreliable floating point equality comparison `root == np.log(5.0 / 3.0) / 0.5`
+ tests/formulary/test_fusion.py:326:16: float-equality-comparison Unreliable floating point equality comparison `sigma.unit == u.m**3 / u.s`
... 17 additional changes omitted for rule float-equality-comparison
+ tests/formulary/test_quantum.py:122:9: missing-f-string-syntax Possible f-string without an `f` prefix
... 16 additional changes omitted for project

docker/docker-py (+47 -5 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --no-fix --output-format concise --preview

+ docker/api/build.py:20:9: escape-sequence-in-docstring Use `r"""` if any backslashes in a docstring
+ docker/api/client.py:472:35: float-equality-comparison Unreliable floating point equality comparison `timeout == 0.0`
+ docker/auth.py:75:18: subclass-builtin Subclassing `dict` can be error prone, use `collections.UserDict` instead
+ docker/context/context.py:76:16: unnecessary-dunder-call Unnecessary dunder call to `__call__`
+ docker/models/containers.py:537:9: escape-sequence-in-docstring Use `r"""` if any backslashes in a docstring
+ docker/types/base.py:1:16: subclass-builtin Subclassing `dict` can be error prone, use `collections.UserDict` instead
+ docker/types/containers.py:264:18: subclass-builtin Subclassing `dict` can be error prone, use `collections.UserDict` instead
+ docker/types/containers.py:688:23: subclass-builtin Subclassing `dict` can be error prone, use `collections.UserDict` instead
+ docker/types/networks.py:54:24: subclass-builtin Subclassing `dict` can be error prone, use `collections.UserDict` instead
+ docker/types/networks.py:5:22: subclass-builtin Subclassing `dict` can be error prone, use `collections.UserDict` instead
... 22 additional changes omitted for rule subclass-builtin
... 42 additional changes omitted for project

facebookresearch/chameleon (+5 -0 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --no-fix --output-format concise --preview

+ chameleon/inference/chameleon.py:387:26: slice-copy [*] Prefer `copy` method over slicing
+ chameleon/inference/stopping_criteria.py:16:28: subclass-builtin Subclassing `list` can be error prone, use `collections.UserList` instead
+ chameleon/inference/vqgan.py:92:32: float-equality-comparison Unreliable floating point equality comparison `temp == 1.0`
+ chameleon/viewer/backend/models/chameleon_distributed.py:394:17: logging-eager-conversion Unnecessary `str()` conversion when formatting with `%s`
+ chameleon/viewer/backend/models/chameleon_distributed.py:475:17: logging-eager-conversion Unnecessary `str()` conversion when formatting with `%s`

ing-bank/probatus (+6 -0 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --no-fix --output-format concise --preview

+ probatus/feature_elimination/feature_elimination.py:1006:40: unnecessary-dict-comprehension-for-iterable [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead
+ probatus/utils/arrayfuncs.py:96:42: pandas-use-of-dot-is-null `.isna` is preferred to `.isnull`; functionality is equivalent
+ probatus/utils/shap_helpers.py:83:13: needless-else [*] Empty `else` clause
+ tests/feature_elimination/test_feature_elimination.py:135:5: pytest-raises-with-multiple-statements `pytest.raises()` block should contain a single simple statement
+ tests/sample_similarity/test_resemblance_model.py:213:12: float-equality-comparison Unreliable floating point equality comparison `train_score == 0.5`
+ tests/sample_similarity/test_resemblance_model.py:214:12: float-equality-comparison Unreliable floating point equality comparison `test_score == 0.5`

prefecthq/prefect (+746 -102 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --no-fix --output-format concise --preview

+ benches/bench_count_flow_runs.py:190:12: blocking-path-method-in-async-function Async functions should not use os.path methods, use trio.Path or anyio.path
+ benches/bench_count_flow_runs.py:1:1: escape-sequence-in-docstring Use `r"""` if any backslashes in a docstring
+ benches/bench_import.py:1:1: escape-sequence-in-docstring Use `r"""` if any backslashes in a docstring
+ client/client_deploy.py:32:20: blocking-path-method-in-async-function Async functions should not use pathlib.Path methods, use trio.Path or anyio.path
+ docs/conftest.py:61:12: unnecessary-dict-comprehension-for-iterable [*] Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead
+ examples/simple_web_scraper.py:103:19: if-exp-instead-of-or-operator [*] Replace ternary `if` expression with `or` operator
+ integration-tests/test_nested_cancellation.py:120:12: blocking-path-method-in-async-function Async functions should not use pathlib.Path methods, use trio.Path or anyio.path
+ integration-tests/test_nested_cancellation.py:53:5: blocking-path-method-in-async-function Async functions should not use pathlib.Path methods, use trio.Path or anyio.path
+ integration-tests/test_nested_cancellation.py:64:5: blocking-path-method-in-async-function Async functions should not use pathlib.Path methods, use trio.Path or anyio.path
+ integration-tests/test_nested_cancellation.py:69:9: blocking-path-method-in-async-function Async functions should not use pathlib.Path methods, use trio.Path or anyio.path
... 84 additional changes omitted for rule blocking-path-method-in-async-function
+ scripts/backfill_release_notes.py:139:20: unnecessary-enumerate `enumerate` index is unused, use `for x in y` instead
+ scripts/backfill_release_notes.py:228:13: repeated-append Use `filtered_lines.extend((f"**{header_text}**", ""))` instead of repeatedly calling `filtered_lines.append()`
+ scripts/backfill_release_notes.py:240:13: repeated-append Use `filtered_lines.extend((f"**{header_text}**", ""))` instead of repeatedly calling `filtered_lines.append()`
- scripts/backfill_release_notes.py:319:20: call-datetime-strptime-without-zone Naive datetime constructed using `datetime.datetime.strptime()` without %z
+ scripts/generate-lower-bounds.py:2:1: escape-sequence-in-docstring Use `r"""` if any backslashes in a docstring
+ scripts/generate_settings_ref.py:10:40: missing-maxsplit-arg [*] String is split more times than necessary
+ scripts/generate_settings_ref.py:117:9: repeated-append Use `docs.extend(...)` instead of repeatedly calling `docs.append()`
+ scripts/prepare_integration_release_notes.py:240:23: missing-maxsplit-arg [*] String is split more times than necessary
- scripts/prepare_integration_release_notes.py:246:53: call-datetime-now-without-tzinfo `datetime.datetime.now()` called without a `tz` argument
- scripts/prepare_integration_release_notes.py:250:36: call-datetime-now-without-tzinfo `datetime.datetime.now()` called without a `tz` argument
+ scripts/prepare_integration_release_notes.py:255:13: repeated-append Use `notes.extend((f"**{category}**", ""))` instead of repeatedly calling `notes.append()`
- scripts/prepare_release_notes.py:113:12: call-datetime-now-without-tzinfo `datetime.datetime.now()` called without a `tz` argument
+ scripts/prepare_release_notes.py:147:20: unnecessary-enumerate `enumerate` index is unused, use `for x in y` instead
+ scripts/prepare_release_notes.py:236:13: repeated-append Use `filtered_lines.extend((f"**{header_text}**", ""))` instead of repeatedly calling `filtered_lines.append()`
+ scripts/prepare_release_notes.py:248:13: repeated-append Use `filtered_lines.extend((f"**{header_text}**", ""))` instead of repeatedly calling `filtered_lines.append()`
... 23 additional changes omitted for rule repeated-append
- scripts/prepare_release_notes.py:337:20: call-datetime-strptime-without-zone Naive datetime constructed using `datetime.datetime.strptime()` without %z
+ scripts/verify_test_selection.py:81:5: reimplemented-builtin Use `return all(not fnmatch.fnmatch(filepath, pattern) for pattern in ignore_globs)` instead of `for` loop
+ src/integrations/prefect-aws/prefect_aws/_cli/utils.py:198:20: single-item-membership-test Membership test against single-item container
+ src/integrations/prefect-aws/prefect_aws/observers/ecs.py:589:15: missing-maxsplit-arg [*] String is split more times than necessary
+ src/integrations/prefect-aws/prefect_aws/workers/ecs_worker.py:758:14: if-exp-instead-of-or-operator [*] Replace ternary `if` expression with `or` operator
... 818 additional changes omitted for project

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

ruff check --no-cache --exit-zero --no-fix --output-format concise --preview

+ cibuildwheel/environment.py:24:5: escape-sequence-in-docstring Use `r"""` if any backslashes in a docstring

pypa/setuptools (+32 -5 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --no-fix --output-format concise --preview

- setuptools/build_meta.py:317:35: noqa-comments [*] `noqa` comment used instead of `ruff: ignore`
+ setuptools/build_meta.py:317:35: unused-noqa [*] Unused `noqa` directive (non-enabled: `S102`)
+ setuptools/command/bdist_wheel.py:112:15: missing-maxsplit-arg [*] String is split more times than necessary
+ setuptools/config/expand.py:116:5: escape-sequence-in-docstring Use `r"""` if any backslashes in a docstring
+ setuptools/depends.py:116:10: none-not-at-end-of-union [*] `None` not at the end of the type union.
+ setuptools/depends.py:146:10: none-not-at-end-of-union [*] `None` not at the end of the type union.
+ setuptools/depends.py:60:10: none-not-at-end-of-union [*] `None` not at the end of the type union.
+ setuptools/dist.py:605:13: unnecessary-dunder-call Unnecessary dunder call to `__init__`. Instantiate class directly.
- setuptools/launch.py:32:28: noqa-comments [*] `noqa` comment used instead of `ruff: ignore`
+ setuptools/launch.py:32:28: unused-noqa [*] Unused `noqa` directive (non-enabled: `S102`)
... 27 additional changes omitted for project

... Truncated remaining completed project reports due to GitHub comment length restrictions

Changes by rule (45 rules affected)

code total + violation - violation + fix - fix
pytest-raises-with-multiple-statements 232 232 0 0 0
float-equality-comparison 148 148 0 0 0
pytest-raises-ambiguous-pattern 143 143 0 0 0
numpy-legacy-random 97 97 0 0 0
blocking-path-method-in-async-function 89 89 0 0 0
unnecessary-dunder-call 75 75 0 0 0
call-datetime-without-tzinfo 74 0 74 0 0
if-exp-instead-of-or-operator 59 59 0 0 0
missing-f-string-syntax 39 39 0 0 0
subclass-builtin 38 38 0 0 0
unnecessary-lambda 38 38 0 0 0
legacy-form-pytest-raises 36 36 0 0 0
repeated-append 33 33 0 0 0
call-datetime-now-without-tzinfo 27 0 27 0 0
slice-copy 26 26 0 0 0
none-not-at-end-of-union 23 23 0 0 0
unnecessary-dict-comprehension-for-iterable 21 21 0 0 0
escape-sequence-in-docstring 15 15 0 0 0
math-constant 15 15 0 0 0
missing-maxsplit-arg 11 11 0 0 0
fallible-context-manager 10 10 0 0 0
for-loop-set-mutations 10 10 0 0 0
logging-eager-conversion 9 9 0 0 0
pytest-patch-with-lambda 9 9 0 0 0
exec-builtin 9 0 9 0 0
meta-class-abc-meta 8 8 0 0 0
reimplemented-builtin 7 7 0 0 0
single-item-membership-test 7 7 0 0 0
useless-finally 7 7 0 0 0
unused-noqa 7 7 0 0 0
noqa-comments 7 0 7 0 0
needless-else 6 6 0 0 0
unnecessary-enumerate 6 6 0 0 0
return-in-generator 5 5 0 0 0
hardcoded-string-charset 5 5 0 0 0
call-datetime-strptime-without-zone 5 0 5 0 0
redundant-bool-literal 3 3 0 0 0
falsy-dict-get-fallback 2 2 0 0 0
fast-api-non-annotated-dependency 2 2 0 0 0
call-date-today 2 0 2 0 0
pandas-use-of-dot-is-null 1 1 0 0 0
abstract-base-class-without-abstract-method 1 1 0 0 0
empty-method-without-abstract-decorator 1 1 0 0 0
implicit-class-var-in-dataclass 1 1 0 0 0
call-datetime-fromtimestamp 1 0 1 0 0

Comment thread crates/ruff_linter/src/rules/airflow/rules/suggested_to_move_to_provider_in_3.rs Outdated
Comment thread crates/ruff_linter/src/rules/airflow/rules/removal_in_3.rs Outdated
@ntBre
ntBre force-pushed the brent/update-preview-category-defaults branch 2 times, most recently from af972d1 to e5074e2 Compare August 19, 2026 20:21
@ntBre
ntBre changed the base branch from brent/category-selectors to brent/category-docs August 19, 2026 20:23
@ntBre
ntBre changed the base branch from brent/category-docs to brent/rule-acceptance-guidelines August 19, 2026 22:39
@ntBre
ntBre force-pushed the brent/update-preview-category-defaults branch from e5074e2 to 7f26ad4 Compare August 20, 2026 13:56
@ntBre
ntBre force-pushed the brent/update-preview-category-defaults branch 2 times, most recently from af813a2 to c87c347 Compare August 20, 2026 14:55
@ntBre
ntBre force-pushed the brent/update-preview-category-defaults branch 2 times, most recently from a1b5d00 to 1e0e0a3 Compare August 20, 2026 19:01
@ntBre
ntBre force-pushed the brent/update-preview-category-defaults branch from 1e0e0a3 to e0ba694 Compare August 21, 2026 17:12
@ntBre
ntBre force-pushed the brent/update-preview-category-defaults branch from e0ba694 to 3e8471a Compare August 21, 2026 17:45
@ntBre
ntBre force-pushed the brent/update-preview-category-defaults branch from 3e8471a to cd035c5 Compare August 21, 2026 19:21
@ntBre
ntBre force-pushed the brent/update-preview-category-defaults branch 3 times, most recently from cec6e47 to e5252dc Compare August 24, 2026 14:01
@ntBre
ntBre force-pushed the brent/update-preview-category-defaults branch from e5252dc to e5d5674 Compare August 25, 2026 18:51
@ntBre
ntBre marked this pull request as ready for review August 25, 2026 19:20
@ntBre
ntBre force-pushed the brent/update-preview-category-defaults branch from e5d5674 to 458df37 Compare August 25, 2026 21:05
Comment thread crates/ruff_linter/src/rules/airflow/rules/dag_schedule_argument.rs
Comment thread crates/ruff_linter/src/rules/flake8_bugbear/rules/abstract_base_class.rs Outdated
Comment thread crates/ruff_linter/src/rules/ruff/rules/pytest_raises_ambiguous_pattern.rs Outdated
Comment thread crates/ruff_linter/src/rules/ruff/rules/unnecessary_if.rs Outdated
/// [F841]: https://docs.astral.sh/ruff/rules/unused-variable/
#[derive(ViolationMetadata)]
#[violation_metadata(stable_since = "0.13.0", category = Category::Correctness)]
#[violation_metadata(stable_since = "0.13.0", category = Category::Suspicious)]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Was this based on the previous discussion when we split out the rule from unused variable?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes: #8884. Alex even called it "stylistic," so we could go lower if you want. I'd personally still consider it a correctness issue like unused-variable, but the _ dummy variable convention doesn't seem widely accepted enough in Python, at least based on our ecosystem results.

Comment thread crates/ruff_linter/src/rules/ruff/rules/useless_finally.rs Outdated
@ntBre
ntBre force-pushed the brent/update-preview-category-defaults branch from 458df37 to c221ce5 Compare August 26, 2026 18:57
@ntBre
ntBre force-pushed the brent/update-preview-category-defaults branch from f9aafcb to eb0752a Compare August 26, 2026 22:48
@ntBre
ntBre force-pushed the brent/update-preview-category-defaults branch from 97de6bc to 8e03ca8 Compare August 27, 2026 13:20
@ntBre
ntBre merged commit 5fdab73 into main Aug 27, 2026
65 checks passed
@ntBre
ntBre deleted the brent/update-preview-category-defaults branch August 27, 2026 15:26
sharkdp pushed a commit that referenced this pull request Aug 31, 2026
## Summary

These are the last five commits from
#27666 that update the preview
default selectors based on the new categorization:
- add current preview rules to the default selectors
- add third-party rules to the default selectors
- add preview rules stabilized in 0.15 to the default selectors (oops)
- incorporate the DTZ and F406 changes from
#27213
- adjust 4 categories that genuinely differ between my previous and
current categorizations

## Test Plan

Updated default rules snapshot
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-selection Related to enabling or disabling rules

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants