Skip to content
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

[pep8-naming] Ignore @override methods (N803) #15954

Merged
merged 2 commits into from
Feb 5, 2025

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.

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