-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
More ruff rules #154
Merged
Merged
More ruff rules #154
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ruff has it's own custom set of linter rules, this enables all of them.
This enables all ruff's flake8-use-pathlib (PTH) extension rules.
This enables all ruff's flake8-async (ASYNC) rules.
This enables all ruff's flake8-quotes (Q) rules.
This enables all ruff's flake8-return (RET) rules.
This enables all ruff's pyupgrade (UP) rules. However UP024 (using errors that alias OSError) is ignored, as that prohibits use of exceptions like `IOError`, which is utilized pretty extensively in mcproto.
This enables all ruff's pylint (PL) rules. However PLR2004 (using unnamed numerical constants) is ignored, as these kinds of constants are used all over the codebase, in comparisons, etc. As mcproto is a fairly low level library, this is not surprising, and in most cases, it's easy to understand what the numerical constant is in the context of that comparison.
This enables all ruff's pygrep-hooks (PGH) rules. However PGH003 (using specific rule codes in type ignores) is ignored, as we're using pyright rather than mypy, and while there are some rulecodes for pyright and we could be more specific, most of the violations just fall under the same (general typing issues) category, which isn't very helpful for categorizing the issue. Because of that, this would just be annoying to do without any huge benefit for it.
ItsDrike
added
p: 2 - normal
Normal priority
t: feature
New request or feature
a: internal
Related to internal API of the project
labels
Jul 15, 2023
ItsDrike
force-pushed
the
more-ruff-rules
branch
from
July 15, 2023 23:59
b824c35
to
8b6c71a
Compare
This enables all ruff's flake8-gettext (INT) rules.
ItsDrike
force-pushed
the
more-ruff-rules
branch
from
July 16, 2023 00:06
8b6c71a
to
109618e
Compare
ItsDrike
force-pushed
the
more-ruff-rules
branch
from
July 16, 2023 00:08
109618e
to
0b49d66
Compare
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Labels
a: internal
Related to internal API of the project
p: 2 - normal
Normal priority
t: feature
New request or feature
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds various new linter rules: