Skip to content

Commit

Permalink
Enable explicitly pycodestyle rules (apache#39322)
Browse files Browse the repository at this point in the history
  • Loading branch information
Taragolis authored Apr 30, 2024
1 parent 8a33c33 commit 2872d37
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,8 @@ extend-select = [
"LOG", # flake8-logging rules, most of them autofixable
"PT", # flake8-pytest-style rules
"TID25", # flake8-tidy-imports rules
"E", # pycodestyle rules
"W", # pycodestyle rules
# Per rule enables
"RUF006", # Checks for asyncio dangling task
"RUF015", # Checks for unnecessary iterable allocation for first element
Expand All @@ -296,22 +298,37 @@ extend-select = [
"B019", # Use of functools.lru_cache or functools.cache on methods can lead to memory leaks
"B028", # No explicit stacklevel keyword argument found
"TRY002", # Prohibit use of `raise Exception`, use specific exceptions instead.
"W605", # Checks for invalid escape sequences which deprecated since Python 3.6
]
ignore = [
"D203",
"D212",
"D213",
"D214",
"D215",
"E731",
"TCH003", # Do not move imports from stdlib to TYPE_CHECKING block
"E731", # Do not assign a lambda expression, use a def
"TCH003", # Do not move imports from stdlib to TYPE_CHECKING block
"PT004", # Fixture does not return anything, add leading underscore
"PT005", # Fixture returns a value, remove leading underscore
"PT006", # Wrong type of names in @pytest.mark.parametrize
"PT007", # Wrong type of values in @pytest.mark.parametrize
"PT011", # pytest.raises() is too broad, set the match parameter
"PT019", # fixture without value is injected as parameter, use @pytest.mark.usefixtures instead
# Rules below explicitly set off which could overlap with Ruff's formatter
# as it recommended by https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules
# Except ISC rules
"W191",
"E111",
"E114",
"E117",
"D206",
"D300",
"Q000",
"Q001",
"Q002",
"Q003",
"COM812",
"COM819",
"E501", # Formatted code may exceed the line length, leading to line-too-long (E501) errors.
]
unfixable = [
# PT022 replace empty `yield` to empty `return`. Might be fixed with a combination of PLR1711
Expand Down

0 comments on commit 2872d37

Please sign in to comment.