Skip to content

Conversation

@harupy
Copy link
Contributor

@harupy harupy commented Dec 26, 2025

Summary

Close #22204

Test Plan

Existing checks

The fix for FURB192 (`sorted-min-max`) was previously marked as safe
when the `reverse` keyword was not used. However, `sorted()` and
`min()`/`max()` handle ties differently: `sorted()` preserves the
original order while `min()`/`max()` return the first matching element.

This can lead to different behavior even without `reverse`, so the fix
is now always marked as unsafe.

Fixes astral-sh#22204
@harupy harupy changed the title [refurb] Mark FURB192 fix as always unsafe [refurb] Mark FURB192 fix as always unsafe Dec 26, 2025
@astral-sh-bot
Copy link

astral-sh-bot bot commented Dec 26, 2025

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

ℹ️ ecosystem check detected linter changes. (+0 -0 violations, +0 -10 fixes in 3 projects; 52 projects unchanged)

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

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

+ providers/yandex/src/airflow/providers/yandex/secrets/lockbox.py:259:16: FURB192 Prefer `min` over `sorted()` to compute the minimum value in a sequence
- providers/yandex/src/airflow/providers/yandex/secrets/lockbox.py:259:16: FURB192 [*] Prefer `min` over `sorted()` to compute the minimum value in a sequence
+ scripts/ci/prek/upgrade_important_versions.py:111:30: FURB192 Prefer `max` over `sorted()` to compute the maximum value in a sequence
- scripts/ci/prek/upgrade_important_versions.py:111:30: FURB192 [*] Prefer `max` over `sorted()` to compute the maximum value in a sequence
+ scripts/ci/prek/upgrade_important_versions.py:150:22: FURB192 Prefer `max` over `sorted()` to compute the maximum value in a sequence
- scripts/ci/prek/upgrade_important_versions.py:150:22: FURB192 [*] Prefer `max` over `sorted()` to compute the maximum value in a sequence

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

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

+ src/scikit_build_core/file_api/reply.py:37:22: FURB192 Prefer `max` over `sorted()` to compute the maximum value in a sequence
- src/scikit_build_core/file_api/reply.py:37:22: FURB192 [*] Prefer `max` over `sorted()` to compute the maximum value in a sequence

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

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

+ astropy/time/core.py:2372:21: FURB192 Prefer `max` over `sorted()` to compute the maximum value in a sequence
- astropy/time/core.py:2372:21: FURB192 [*] Prefer `max` over `sorted()` to compute the maximum value in a sequence

Changes by rule (1 rules affected)

code total + violation - violation + fix - fix
FURB192 10 0 0 0 10

@ntBre ntBre added fixes Related to suggested fixes for violations preview Related to preview mode features labels Dec 29, 2025
Copy link
Contributor

@ntBre ntBre left a comment

Choose a reason for hiding this comment

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

Perfect, thank you!

@ntBre ntBre merged commit 6730350 into astral-sh:main Dec 29, 2025
42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fixes Related to suggested fixes for violations preview Related to preview mode features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FURB192 fix should always be unsafe?

2 participants