Skip to content

[ruff] Exempt NewType calls where the original type is immutable (RUF009) - #15588

Merged
dhruvmanila merged 3 commits into
astral-sh:mainfrom
InSyncWithFoo:RUF009
Jan 20, 2025
Merged

dhruvmanila merged 3 commits into
astral-sh:mainfrom
InSyncWithFoo:RUF009

Conversation

@InSyncWithFoo

Copy link
Copy Markdown
Contributor

Summary

Resolves #6447.

Test Plan

cargo nextest run and cargo insta test.

@github-actions

github-actions Bot commented Jan 20, 2025 •

Copy link
Copy Markdown
Contributor

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Comment thread crates/ruff_linter/src/rules/ruff/rules/function_call_in_dataclass_default.rs Outdated
Comment thread crates/ruff_linter/src/rules/ruff/rules/function_call_in_dataclass_default.rs Outdated
@dhruvmanila dhruvmanila added the bug An issue describing something that isn't working, or a PR that fixes a bug label Jan 20, 2025
Comment thread crates/ruff_python_semantic/src/analyze/typing.rs Outdated
Comment thread crates/ruff_python_semantic/src/analyze/typing.rs Outdated
@dhruvmanila
dhruvmanila merged commit 4cfa355 into astral-sh:main Jan 20, 2025
@InSyncWithFoo
InSyncWithFoo deleted the RUF009 branch January 20, 2025 14:51
dhruvmanila added a commit that referenced this pull request Jan 29, 2025
…immutable (`B008`) (#15765)

## Summary

Resolves #12717.

This change incorporates the logic added in #15588.

## Test Plan

`cargo nextest run` and `cargo insta test`.

---------

Co-authored-by: Dhruv Manilawala <dhruvmanila@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug An issue describing something that isn't working, or a PR that fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

False positive with RUF009 using NewType, Final and dataclass

3 participants