Skip to content

[ruff] Frozen Dataclass default should be valid (RUF009) #18735

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

Merged
merged 19 commits into from
Jun 23, 2025

Conversation

lubaskinc0de
Copy link
Contributor

@lubaskinc0de lubaskinc0de commented Jun 17, 2025

Summary

/closes #17424

Test Plan

@lubaskinc0de lubaskinc0de changed the title RUF009 - Frozen Dataclass default should be valid #17424 [ruff] Frozen Dataclass default should be valid #17424 Jun 17, 2025
@lubaskinc0de lubaskinc0de marked this pull request as ready for review June 18, 2025 21:31
@lubaskinc0de lubaskinc0de marked this pull request as draft June 18, 2025 21:31
@lubaskinc0de lubaskinc0de marked this pull request as ready for review June 18, 2025 21:32
@lubaskinc0de
Copy link
Contributor Author

ready for review

@lubaskinc0de
Copy link
Contributor Author

i am also fixed dataclass_kind helper more info here https://discord.com/channels/1039017663004942429/1039017663512449056/1385177991319126117

@MichaReiser MichaReiser changed the title [ruff] Frozen Dataclass default should be valid #17424 [ruff] Frozen Dataclass default should be valid Jun 19, 2025
Copy link
Contributor

github-actions bot commented Jun 20, 2025

ruff-ecosystem results

Linter (stable)

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

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

+ reflex/event.py:573:72: RUF100 [*] Unused `noqa` directive (unused: `RUF009`)

Changes by rule (1 rules affected)

code total + violation - violation + fix - fix
RUF100 1 1 0 0 0

Linter (preview)

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

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

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

+ reflex/event.py:573:72: RUF100 [*] Unused `noqa` directive (unused: `RUF009`)

Changes by rule (1 rules affected)

code total + violation - violation + fix - fix
RUF100 1 1 0 0 0

@ntBre ntBre self-requested a review June 23, 2025 14:20
@ntBre ntBre added the rule Implementing or modifying a lint rule label Jun 23, 2025
@ntBre ntBre changed the title [ruff] Frozen Dataclass default should be valid [ruff] Frozen Dataclass default should be valid (RUF009) Jun 23, 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.

Thanks, this looks great overall! I just have a few suggestions for simplifying things a bit.

@lubaskinc0de lubaskinc0de requested a review from ntBre June 23, 2025 18:24
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.

Thank you, this is great! Just one more tiny nit, and it looks like clippy also has a minor complaint, but this is otherwise good to go.

@lubaskinc0de lubaskinc0de requested a review from ntBre June 23, 2025 19:05
@ntBre ntBre enabled auto-merge (squash) June 23, 2025 19:07
@ntBre ntBre merged commit 885dc90 into astral-sh:main Jun 23, 2025
32 checks passed
dcreager added a commit that referenced this pull request Jun 24, 2025
* main:
  [ty] Fix false positives when subscripting an object inferred as having an `Intersection` type (#18920)
  [`flake8-use-pathlib`] Add autofix for `PTH202` (#18763)
  [ty] Add relative import completion tests
  [ty] Clarify what "cursor" means
  [ty] Add a cursor test builder
  [ty] Enforce sort order of completions (#18917)
  [formatter] Fix missing blank lines before decorated classes in .pyi files (#18888)
  Apply fix availability and applicability when adding to `DiagnosticGuard` and remove `NoqaCode::rule` (#18834)
  py-fuzzer: allow relative executable paths (#18915)
  [ty] Change `environment.root` to accept multiple paths (#18913)
  [ty] Rename `src.root` setting to `environment.root` (#18760)
  Use file path for detecting package root (#18914)
  Consider virtual path for various server actions (#18910)
  [ty] Introduce `UnionType::try_from_elements` and `UnionType::try_map` (#18911)
  [ty] Support narrowing on `isinstance()`/`issubclass()` if the second argument is a dynamic, intersection, union or typevar type (#18900)
  [ty] Add decorator check for implicit attribute assignments (#18587)
  [`ruff`] Trigger `RUF037` for empty string and byte strings (#18862)
  [ty] Avoid duplicate diagnostic in unpacking (#18897)
  [`pyupgrade`] Extend version detection to include `sys.version_info.major` (`UP036`) (#18633)
  [`ruff`] Frozen Dataclass default should be valid (`RUF009`) (#18735)
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.

RUF009 - Frozen Dataclass default should be valid
3 participants