|
3 | 3 | target-version = "py310" |
4 | 4 |
|
5 | 5 | select = [ |
6 | | - "B007", # Loop control variable {name} not used within loop body |
7 | | - "B014", # Exception handler with duplicate exception |
8 | | - "C", # complexity |
9 | | - "D", # docstrings |
10 | | - "E", # pycodestyle |
11 | | - "F", # pyflakes/autoflake |
12 | | - "ICN001", # import concentions; {name} should be imported as {asname} |
| 6 | + "B002", # Python does not support the unary prefix increment |
| 7 | + "B007", # Loop control variable {name} not used within loop body |
| 8 | + "B014", # Exception handler with duplicate exception |
| 9 | + "B023", # Function definition does not bind loop variable {name} |
| 10 | + "B026", # Star-arg unpacking after a keyword argument is strongly discouraged |
| 11 | + "B904", # Use raise from to specify exception cause |
| 12 | + "C", # complexity |
| 13 | + "COM818", # Trailing comma on bare tuple prohibited |
| 14 | + "D", # docstrings |
| 15 | + "DTZ003", # Use datetime.now(tz=) instead of datetime.utcnow() |
| 16 | + "DTZ004", # Use datetime.fromtimestamp(ts, tz=) instead of datetime.utcfromtimestamp(ts) |
| 17 | + "E", # pycodestyle |
| 18 | + "F", # pyflakes/autoflake |
| 19 | + "G", # flake8-logging-format |
| 20 | + "I", # isort |
| 21 | + "ICN001", # import concentions; {name} should be imported as {asname} |
| 22 | + "N804", # First argument of a class method should be named cls |
| 23 | + "N805", # First argument of a method should be named self |
| 24 | + "N815", # Variable {name} in class scope should not be mixedCase |
13 | 25 | "PGH004", # Use specific rule codes when using noqa |
14 | 26 | "PLC0414", # Useless import alias. Import alias does not rename original package. |
15 | | - "SIM105", # Use contextlib.suppress({exception}) instead of try-except-pass |
16 | | - "SIM117", # Merge with-statements that use the same scope |
17 | | - "SIM118", # Use {key} in {dict} instead of {key} in {dict}.keys() |
18 | | - "SIM201", # Use {left} != {right} instead of not {left} == {right} |
19 | | - "SIM212", # Use {a} if {a} else {b} instead of {b} if not {a} else {a} |
20 | | - "SIM300", # Yoda conditions. Use 'age == 42' instead of '42 == age'. |
21 | | - "SIM401", # Use get from dict with default instead of an if block |
22 | | - "T20", # flake8-print |
23 | | - "TRY004", # Prefer TypeError exception for invalid type |
24 | | - "RUF006", # Store a reference to the return value of asyncio.create_task |
25 | | - "UP", # pyupgrade |
26 | | - "W", # pycodestyle |
| 27 | + "PLC", # pylint |
| 28 | + "PLE", # pylint |
| 29 | + "PLR", # pylint |
| 30 | + "PLW", # pylint |
| 31 | + "Q000", # Double quotes found but single quotes preferred |
| 32 | + "RUF006", # Store a reference to the return value of asyncio.create_task |
| 33 | + "S102", # Use of exec detected |
| 34 | + "S103", # bad-file-permissions |
| 35 | + "S108", # hardcoded-temp-file |
| 36 | + "S306", # suspicious-mktemp-usage |
| 37 | + "S307", # suspicious-eval-usage |
| 38 | + "S313", # suspicious-xmlc-element-tree-usage |
| 39 | + "S314", # suspicious-xml-element-tree-usage |
| 40 | + "S315", # suspicious-xml-expat-reader-usage |
| 41 | + "S316", # suspicious-xml-expat-builder-usage |
| 42 | + "S317", # suspicious-xml-sax-usage |
| 43 | + "S318", # suspicious-xml-mini-dom-usage |
| 44 | + "S319", # suspicious-xml-pull-dom-usage |
| 45 | + "S320", # suspicious-xmle-tree-usage |
| 46 | + "S601", # paramiko-call |
| 47 | + "S602", # subprocess-popen-with-shell-equals-true |
| 48 | + "S604", # call-with-shell-equals-true |
| 49 | + "S608", # hardcoded-sql-expression |
| 50 | + "S609", # unix-command-wildcard-injection |
| 51 | + "SIM105", # Use contextlib.suppress({exception}) instead of try-except-pass |
| 52 | + "SIM117", # Merge with-statements that use the same scope |
| 53 | + "SIM118", # Use {key} in {dict} instead of {key} in {dict}.keys() |
| 54 | + "SIM201", # Use {left} != {right} instead of not {left} == {right} |
| 55 | + "SIM208", # Use {expr} instead of not (not {expr}) |
| 56 | + "SIM212", # Use {a} if {a} else {b} instead of {b} if not {a} else {a} |
| 57 | + "SIM300", # Yoda conditions. Use 'age == 42' instead of '42 == age'. |
| 58 | + "SIM401", # Use get from dict with default instead of an if block |
| 59 | + "T100", # Trace found: {name} used |
| 60 | + "T20", # flake8-print |
| 61 | + "TID251", # Banned imports |
| 62 | + "TRY004", # Prefer TypeError exception for invalid type |
| 63 | + "TRY302", # Remove exception handler; error is immediately re-raised |
| 64 | + "UP", # pyupgrade |
| 65 | + "W", # pycodestyle |
27 | 66 | ] |
28 | 67 |
|
29 | 68 | ignore = [ |
30 | | - "D202", # No blank lines allowed after function docstring |
31 | | - "D203", # 1 blank line required before class docstring |
32 | | - "D213", # Multi-line docstring summary should start at the second line |
33 | | - "D404", # First word of the docstring should not be This |
34 | | - "D406", # Section name should end with a newline |
35 | | - "D407", # Section name underlining |
36 | | - "D411", # Missing blank line before section |
37 | | - "E501", # line too long |
38 | | - "E731", # do not assign a lambda expression, use a def |
| 69 | + "D202", # No blank lines allowed after function docstring |
| 70 | + "D203", # 1 blank line required before class docstring |
| 71 | + "D213", # Multi-line docstring summary should start at the second line |
| 72 | + "D406", # Section name should end with a newline |
| 73 | + "D407", # Section name underlining |
| 74 | + "E501", # line too long |
| 75 | + "E731", # do not assign a lambda expression, use a def |
| 76 | + |
| 77 | + # Ignore ignored, as the rule is now back in preview/nursery, which cannot |
| 78 | + # be ignored anymore without warnings. |
| 79 | + # https://github.com/astral-sh/ruff/issues/7491 |
| 80 | + # "PLC1901", # Lots of false positives |
| 81 | + |
| 82 | + # False positives https://github.com/astral-sh/ruff/issues/5386 |
| 83 | + "PLC0208", # Use a sequence type instead of a `set` when iterating over values |
| 84 | + "PLR0911", # Too many return statements ({returns} > {max_returns}) |
| 85 | + "PLR0912", # Too many branches ({branches} > {max_branches}) |
| 86 | + "PLR0913", # Too many arguments to function call ({c_args} > {max_args}) |
| 87 | + "PLR0915", # Too many statements ({statements} > {max_statements}) |
| 88 | + "PLR2004", # Magic value used in comparison, consider replacing {value} with a constant variable |
| 89 | + "PLW2901", # Outer {outer_kind} variable {name} overwritten by inner {inner_kind} target |
| 90 | + "UP006", # keep type annotation style as is |
| 91 | + "UP007", # keep type annotation style as is |
| 92 | + # Ignored due to performance: https://github.com/charliermarsh/ruff/issues/2923 |
| 93 | + "UP038", # Use `X | Y` in `isinstance` call instead of `(X, Y)` |
| 94 | + |
| 95 | + # May conflict with the formatter, https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules |
| 96 | + "W191", |
| 97 | + "E111", |
| 98 | + "E114", |
| 99 | + "E117", |
| 100 | + "D206", |
| 101 | + "D300", |
| 102 | + "Q000", |
| 103 | + "Q001", |
| 104 | + "Q002", |
| 105 | + "Q003", |
| 106 | + "COM812", |
| 107 | + "COM819", |
| 108 | + "ISC001", |
| 109 | + "ISC002", |
| 110 | + |
| 111 | + # Disabled because ruff does not understand type of __all__ generated by a function |
| 112 | + "PLE0605", |
39 | 113 | ] |
40 | 114 |
|
41 | 115 | [flake8-pytest-style] |
|
0 commit comments