Skip to content

[flake8-pyi] Respect pep8_naming.classmethod-decorators settings when determining if a method is a classmethod in custom-type-var-return-type (PYI019)#13162

Merged
AlexWaygood merged 1 commit intomainfrom
alex/dunder-new
Aug 30, 2024
Merged

Conversation

@AlexWaygood
Copy link
Copy Markdown
Member

Summary

I noticed that PYI019 was using its own routines for determining whether a function was a classmethod or not, when most of our linter rules use ruff_python_semantic::function_type::classify() for this purpose. Using the common method in PYI019 means that this rule will benefit from any bugfixes we make to classify() in the future, and also means that this rule now respects the pep8_naming.classmethod-decorators setting when deciding whether a method is a classmethod or not.

Test Plan

cargo test -p ruff_linter

…when determining if a method is a classmethod in `custom-type-var-return-type` (`PYI019`)
@AlexWaygood AlexWaygood added bug Something isn't working rule Implementing or modifying a lint rule labels Aug 30, 2024
@github-actions
Copy link
Copy Markdown
Contributor

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@AlexWaygood AlexWaygood merged commit 34b4732 into main Aug 30, 2024
@AlexWaygood AlexWaygood deleted the alex/dunder-new branch August 30, 2024 13:24
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.

2 participants