|
| 1 | +target-version = "py312" |
| 2 | + |
| 3 | +# fix = true |
| 4 | +lint.unfixable = [] |
| 5 | + |
| 6 | +lint.select = [ |
| 7 | + "I", # isort |
| 8 | + "F", # pyflakes |
| 9 | + "E", "W", # pycodestyle |
| 10 | + "YTT", # flake8-2020 |
| 11 | + "B", # flake8-bugbear |
| 12 | + "Q", # flake8-quotes |
| 13 | + "T10", # flake8-debugger |
| 14 | + "INT", # flake8-gettext |
| 15 | + "PLC", "PLE", "PLR", "PLW", # pylint |
| 16 | + "PIE", # misc lints |
| 17 | + "PYI", # flake8-pyi |
| 18 | + "TID", # tidy imports |
| 19 | + "ISC", # implicit string concatenation |
| 20 | + "TCH", # type-checking imports |
| 21 | + "C4", # comprehensions |
| 22 | + "PGH" # pygrep-hooks |
| 23 | +] |
| 24 | + |
| 25 | +# Some additional rules that are useful |
| 26 | +lint.extend-select = [ |
| 27 | +"UP009", # UTF-8 encoding declaration is unnecessary |
| 28 | +"SIM118", # Use `key in dict` instead of `key in dict.keys()` |
| 29 | +"D205", # One blank line required between summary line and description |
| 30 | +"ARG001", # Unused function argument |
| 31 | +"RSE102", # Unnecessary parentheses on raised exception |
| 32 | +"PERF401", # Use a list comprehension to create a transformed list |
| 33 | +"S101", # Use of `assert` detected |
| 34 | +] |
| 35 | + |
| 36 | +lint.ignore = [ |
| 37 | + "ISC001", # Disable this for compatibility with ruff format |
| 38 | + "E402", # module level import not at top of file |
| 39 | + "E731", # do not assign a lambda expression, use a def |
| 40 | + "PLR2004", # Magic number |
| 41 | + "B028", # No explicit `stacklevel` keyword argument found |
| 42 | + "PLR0913", # Too many arguments to function call |
| 43 | + "PLR1730", # Checks for if statements that can be replaced with min() or max() calls |
| 44 | + "PLC0415", # `import` should be at the top-level of a file |
| 45 | + "PLW1641", # Class implements `__hash__` if `__eq__` is implemented, |
| 46 | +] |
| 47 | + |
| 48 | +extend-exclude = [ |
| 49 | + "doc", |
| 50 | + "build", |
| 51 | +] |
| 52 | + |
| 53 | +[lint.pycodestyle] |
| 54 | +max-line-length = 100 # E501 reports lines that exceed the length of 100. |
| 55 | + |
| 56 | +[lint.extend-per-file-ignores] |
| 57 | +"__init__.py" = ["E402", "F401", "F403"] |
| 58 | +# For tests: |
| 59 | +# - D205: Don't worry about test docstrings |
| 60 | +# - ARG001: Unused function argument false positives for some fixtures |
| 61 | +# - E501: Line-too-long |
| 62 | +# - S101: Do not use assert |
| 63 | +"**/tests/*test*.py" = ["D205", "ARG001", "E501", "S101"] |
0 commit comments