-
Notifications
You must be signed in to change notification settings - Fork 1
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
Enable many more Ruff linter rules #214
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,49 +72,9 @@ ignore = [ | |
{% if include_exists("ruff/lint/ignore") %} | ||
{{ include("ruff/lint/ignore", indent=4) -}} | ||
{% else %} | ||
"UP", # pyupgrade | ||
"YTT", # flake8-2020 (checks for misuse of sys.version or sys.version_info | ||
"ANN", # flake8-annotations (checks for absence of type annotations on functions) | ||
"ASYNC", # flake8-async (checks for asyncio-related problems) | ||
"S", # flake8-bandit (checks for security issues) | ||
"FBT", # flake8-boolean-trap (checks for the "boolean trap" anti-pattern) | ||
"B", # flake8-bugbear (checks for bugs and design problems) | ||
"A", # flake8-builtins (checks for builtins being overridden) | ||
"CPY", # flake8-copyright (checks for missing copyright notices) | ||
"C4", # flake8-comprehensions (helps write better list/set/dict comprehensions) | ||
"DTZ", # flake8-datetimez (checks for usages of unsafe naive datetime class) | ||
"T10", # flake8-debugger (checks for set traces etc) | ||
"EM", # flake8-errmsg (checks for error message formatting issues) | ||
"EXE", # flake8-executable (checks for incorrect executable permissions and shebangs) | ||
"FA", # flake8-future-annotations (checks for missing from __future__ import annotations) | ||
"ISC", # flake8-implicit-str-concat (checks for style problems with string literal concatenation) | ||
"ICN", # flake8-import-conventions (checks for unconventional imports and aliases) | ||
"LOG", # flake8-logging (checks for issues with using the logging module) | ||
"G", # flake8-logging-format (enforce usage of `extra` in logging calls) | ||
"INP", # flake8-no-pep420 (checks for missing __init__.py files) | ||
"PIE", # flake8-pie (miscellaneous) | ||
"T20", # flake8-print (checks for print and pprint statements) | ||
"PT", # flake8-pytest-style (checks for common pytest style and consistency issues) | ||
"RSE", # flake8-raise (checks for issues with raising exceptions) | ||
"RET", # flake8-return (checks for issues with return values) | ||
"SLOT", # flake8-slots (requires __slots__ in subclasses of immutable types) | ||
"SIM", # flake8-simplify (lots of code simplification checks) | ||
"TID", # flake8-tidy-imports (checks for issues with imports) | ||
"TC", # flake8-type-checking (checks for type checking imports that aren't in TYPE_CHECKING blocks) | ||
"ARG", # flake8-unused-arguments (checks for unused arguments) | ||
"PTH", # flake8-use-pathlib (checks for cases with pathlib could be used but isn't) | ||
"TD", # flake8-todos (enforces good style for "# TODO" comments) | ||
"FIX", # flake8-fixme (checks for FIXMEs, TODOs, HACKs, etc) | ||
"ERA", # eradicate (checks for commented-out code) | ||
"PGH", # pygrep-hooks (miscellaneous) | ||
"PL", # pylint (miscellaneous rules from pylint) | ||
"TRY", # tryceratops (various try/except-related checks) | ||
"FLY", # flynt (checks for old-style %-formatted strings) | ||
"PERF", # perflint (checks for performance anti-patterns) | ||
"FURB", # refurb (various "refurbishing and modernizing" checks) | ||
"DOC", # pydoclint (docstring checks) | ||
"RUF", # Ruff-specific rules | ||
"COM", # flake8-commas (we used a code formatter so we don't need a linter to check this) | ||
"COM", # flake8-commas (we use a code formatter so we don't need a linter to check this) | ||
"D100","D101","D102","D103","D104","D105","D106","D107", # Missing docstrings. | ||
"D202", # "No blank lines allowed after function docstring" conflicts with the Ruff code formatter. | ||
# "Multi-line docstring summary should start at the first line" (D212) | ||
|
@@ -153,10 +113,20 @@ ignore = [ | |
"PLR0913", # Too many arguments. Tests often have lots of arguments. | ||
"PLR0917", # Too many positional arguments. Tests often have lots of arguments. | ||
"PLR0904", # Too many public methods. Test classes often have lots of test methods. | ||
"S101", # Use of `assert` detected. | ||
{% if include_exists("ruff/lint/per_file_ignores/tests/tail") %} | ||
{{ include("ruff/lint/per_file_ignores/tests/tail", indent=4) -}} | ||
{% endif %} | ||
] | ||
"__init__.py" = [ | ||
"F401", # Ignore unused import errors on __init__ files to avoid having to add either a noqa stament or an __all__ declaration. | ||
] | ||
"{{ cookiecutter.package_name }}/migrations/*" = [ | ||
"INP001", | ||
] | ||
"bin/*" = [ | ||
"INP001", | ||
] | ||
Comment on lines
+124
to
+129
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing |
||
{% if include_exists("ruff/lint/per_file_ignores/tail") %} | ||
{{ include("ruff/lint/per_file_ignores/tail") -}} | ||
{% endif %} | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,5 +5,5 @@ | |
|
||
def run(): | ||
while True: | ||
print(hello_world()) | ||
print(hello_world()) # noqa: T201 | ||
time.sleep(1) |
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We want to allow
assert
's in tests, obviously.