diff options
Diffstat (limited to '.ruff.toml')
| -rw-r--r-- | .ruff.toml | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/.ruff.toml b/.ruff.toml new file mode 100644 index 0000000..23428fe --- /dev/null +++ b/.ruff.toml | |||
| @@ -0,0 +1,91 @@ | |||
| 1 | cache-dir = "~/.cache/ruff" | ||
| 2 | indent-width = 4 | ||
| 3 | line-length = 79 | ||
| 4 | target-version = "py312" | ||
| 5 | |||
| 6 | [lint] | ||
| 7 | select = ["ALL"] | ||
| 8 | ignore = [ | ||
| 9 | "BLE001", | ||
| 10 | "COM812", | ||
| 11 | "D2", | ||
| 12 | "D4", | ||
| 13 | "EM101", # Exception must not use a string literal, assign to variable first | ||
| 14 | "EM102", # Exception must not use an f-string literal, assign to variable first | ||
| 15 | "S603", | ||
| 16 | "T201", | ||
| 17 | "TRY003" | ||
| 18 | # "UP020" | ||
| 19 | ] | ||
| 20 | |||
| 21 | # BLE001 - Do not catch blind exception: `Exception` | ||
| 22 | # C901 - `outside_temperature` is too complex (12 > 10) | ||
| 23 | # COM812 - Trailing comma missing | ||
| 24 | # D101 - Missing docstring in public class | ||
| 25 | # D102 - Missing docstring in public method | ||
| 26 | # D200 - One-line docstring should fit on one line | ||
| 27 | # D202 - No blank lines allowed after function docstring | ||
| 28 | # D203 - 1 blank line required before class docstring | ||
| 29 | # D205 - 1 blank line required between summary line and description | ||
| 30 | # D212 - Multi-line docstring summary should start at the first line | ||
| 31 | # D400 - First line should end with a period | ||
| 32 | # D401 - First line of docstring should be in imperative mood | ||
| 33 | # D403 - First word of the first line should be capitalized: `str` -> `Str` | ||
| 34 | # D415 - First line should end with a period, question mark, or exclamation point | ||
| 35 | # ERA001 - Found commented-out code | ||
| 36 | # FBT001 - Boolean-typed positional argument in function definition | ||
| 37 | # FBT002 - Boolean default positional argument in function definition | ||
| 38 | # INP001 - File `beinc_weechat.py` is part of an implicit namespace package. Add an `__init__.py` | ||
| 39 | # PTH100 - `os.path.abspath()` should be replaced by `Path.resolve()` | ||
| 40 | # PTH109 - `os.getcwd()` should be replaced by `Path.cwd()` | ||
| 41 | # PTH111 - `os.path.expanduser()` should be replaced by `Path.expanduser()` | ||
| 42 | # PTH123 - `open()` should be replaced by `Path.open()` | ||
| 43 | # PLR0912 - Too many branches (13 > 12) | ||
| 44 | # PLR0913 - Too many arguments in function definition (6 > 5) | ||
| 45 | # PLR2004 - Magic value used in comparison, consider replacing `200` with a constant variable | ||
| 46 | # RUF012 - Mutable class attributes should be annotated with `typing.ClassVar` | ||
| 47 | # RUF013 - PEP 484 prohibits implicit `Optional` | ||
| 48 | # S101 - Use of `assert` detected | ||
| 49 | # S308 - Use of `mark_safe` may expose cross-site scripting vulnerabilities | ||
| 50 | # S603 - `subprocess` call: check for execution of untrusted input | ||
| 51 | # T201 - `print` found | ||
| 52 | # TRY003 - Avoid specifying long messages outside the exception class | ||
| 53 | # TRY300 - Consider moving this statement to an `else` block | ||
| 54 | # UP020 - Use builtin `open` | ||
| 55 | |||
| 56 | # Allow fix for all enabled rules (when `--fix`) is provided. | ||
| 57 | fixable = ["ALL"] | ||
| 58 | unfixable = [] | ||
| 59 | |||
| 60 | [format] | ||
| 61 | # Like Black, use double quotes for strings. | ||
| 62 | quote-style = "single" | ||
| 63 | |||
| 64 | # Like Black, indent with spaces, rather than tabs. | ||
| 65 | indent-style = "space" | ||
| 66 | |||
| 67 | # Like Black, respect magic trailing commas. | ||
| 68 | skip-magic-trailing-comma = true | ||
| 69 | |||
| 70 | # Like Black, automatically detect the appropriate line ending. | ||
| 71 | line-ending = "lf" | ||
| 72 | |||
| 73 | # Enable auto-formatting of code examples in docstrings. Markdown, | ||
| 74 | # reStructuredText code/literal blocks and doctests are all supported. | ||
| 75 | # | ||
| 76 | # This is currently disabled by default, but it is planned for this | ||
| 77 | # to be opt-out in the future. | ||
| 78 | docstring-code-format = false | ||
| 79 | |||
| 80 | # Set the line length limit used when formatting code snippets in | ||
| 81 | # docstrings. | ||
| 82 | # | ||
| 83 | # This only has an effect when the `docstring-code-format` setting is | ||
| 84 | # enabled. | ||
| 85 | docstring-code-line-length = "dynamic" | ||
| 86 | |||
| 87 | [lint.flake8-quotes] | ||
| 88 | inline-quotes = "single" | ||
| 89 | |||
| 90 | [lint.isort] | ||
| 91 | split-on-trailing-comma = false | ||
