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

Improve descriptions of our error codes #450

Merged
merged 1 commit into from
Nov 20, 2023

Conversation

AlexWaygood
Copy link
Collaborator

@AlexWaygood AlexWaygood commented Nov 19, 2023

This PR tries to make the motivation for each flake8-pyi rule clear. As ruff has reimplemented flake8-pyi's error codes, it's come up a number of times that it isn't always 100% clear why we're enforcing a particular rule: some of our error codes enforce things to do with correctness, but some of them are purely stylistic. (See astral-sh/ruff#8765 for a recent example.) I've tried to divide our error codes into four broad categories to rectify this.

Several of our rules are specifically to do with things working differently in a stub file compared to at runtime. For some of these rules, I've also tried to add a few more words to explain exactly how stubs differ from .py files.

@AlexWaygood
Copy link
Collaborator Author

AlexWaygood commented Nov 19, 2023

Some of the rules are borderline between categories -- e.g. Y041 could be categorised as "removing redundant code" or a "purely stylistic" lint. For codes like this, you could possibly give them more complex categorisations such as "Style/redundant code", etc. However, to keep things simple (and to prevent the third column in the table from becoming too wide when it's rendered by GitHub), I've tried to avoid doing that.

@AlexWaygood AlexWaygood merged commit 504ef82 into PyCQA:main Nov 20, 2023
1 check passed
@AlexWaygood AlexWaygood deleted the better-docs branch November 20, 2023 09:01
@AlexWaygood AlexWaygood restored the better-docs branch February 22, 2024 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants