Skip to content

Conversation

@InSyncWithFoo
Copy link
Contributor

Summary

Resolves #15925.

N803 now checks for functions instead of parameters. In preview mode, if a method is decorated with @override and the current scope is that of a class, it will be ignored.

Test Plan

cargo nextest run and cargo insta test.

@InSyncWithFoo
Copy link
Contributor Author

See also #15296, which proposes that N803 and other pep8-naming rules should not apply for stubs.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2025

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@MichaReiser
Copy link
Member

Would you mind taking a look at the ecosystem check. They all seem wrong because there are no @override decorators involved.

I'd also be fine to ship this without preview because I consider it a bug fix. But I'm also okay to keep it behind preview.

@InSyncWithFoo
Copy link
Contributor Author

@MichaReiser This is due to the rule no longer checking lambdas. Fixed.

@MichaReiser MichaReiser added bug Something isn't working rule Implementing or modifying a lint rule labels Feb 5, 2025
Copy link
Member

@MichaReiser MichaReiser 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

@MichaReiser MichaReiser merged commit 82cb867 into astral-sh:main Feb 5, 2025
21 checks passed
@InSyncWithFoo InSyncWithFoo deleted the N803 branch February 5, 2025 17:11
MichaReiser added a commit that referenced this pull request Mar 13, 2025
…nvalid-argument-name`) (#16667)

## Summary

This PR stabilizes the preview behavior for `invalid-argument-name`
(`N803`)
to ignore argument names of functions decorated with `typing.override`
because
these methods are *out of the authors* control. 

This behavior was introduced in
#15954
and released as part of Ruff 0.9.5 (6th of February). 

There have been no new issues or PRs since this behavior change
(preview) was introduced.
MichaReiser added a commit that referenced this pull request Mar 13, 2025
…nvalid-argument-name`) (#16667)

## Summary

This PR stabilizes the preview behavior for `invalid-argument-name`
(`N803`)
to ignore argument names of functions decorated with `typing.override`
because
these methods are *out of the authors* control. 

This behavior was introduced in
#15954
and released as part of Ruff 0.9.5 (6th of February). 

There have been no new issues or PRs since this behavior change
(preview) was introduced.
MichaReiser added a commit that referenced this pull request Mar 13, 2025
…nvalid-argument-name`) (#16667)

## Summary

This PR stabilizes the preview behavior for `invalid-argument-name`
(`N803`)
to ignore argument names of functions decorated with `typing.override`
because
these methods are *out of the authors* control. 

This behavior was introduced in
#15954
and released as part of Ruff 0.9.5 (6th of February). 

There have been no new issues or PRs since this behavior change
(preview) was introduced.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working rule Implementing or modifying a lint rule

Projects

None yet

Development

Successfully merging this pull request may close these issues.

False-positive N803 with overrides

2 participants