diff options
Diffstat (limited to '.ruff.toml')
| -rw-r--r-- | .ruff.toml | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/.ruff.toml b/.ruff.toml new file mode 100644 index 0000000..add2491 --- /dev/null +++ b/.ruff.toml | |||
| @@ -0,0 +1,73 @@ | |||
| 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 = ["ANN", "COM812", "D105", "D202", "D203", "D205", "D211", "D212", "D400", "D401", "D403", "D415", "ERA001", "FBT001", "FBT002", "PTH111", "RUF012", "RUF013", "S101", "TRY300", "BLE001", "UP020", "C901", "D200", "D402", "EM101", "EM102", "FBT003", "INP001", "PLR0912", "PLR0913", "PLR0915", "PLR2004", "PLW2901", "S603", "T201", "TRY003", "TRY400"] | ||
| 9 | # D105 - Missing docstring in magic method | ||
| 10 | # D200 - One-line docstring should fit on one line | ||
| 11 | # D203 - 1 blank line required before class docstring | ||
| 12 | # D205 - 1 blank line required between summary line and description | ||
| 13 | # D403 - First word of the first line should be capitalized: `str` -> `Str` | ||
| 14 | # FBT001 - Boolean-typed positional argument in function definition | ||
| 15 | # FBT002 - Boolean default positional argument in function definition | ||
| 16 | # PTH111 - `os.path.expanduser()` should be replaced by `Path.expanduser()` | ||
| 17 | # RUF012 - Mutable class attributes should be annotated with `typing.ClassVar` | ||
| 18 | # RUF013 - PEP 484 prohibits implicit `Optional` | ||
| 19 | # S101 - Use of `assert` detected | ||
| 20 | # TRY300 - Consider moving this statement to an `else` block | ||
| 21 | # TRY400 - Use `logging.exception` instead of `logging.error` | ||
| 22 | # UP020 - Use builtin `open` | ||
| 23 | |||
| 24 | # Project specific | ||
| 25 | # C901 - `X` is too complex | ||
| 26 | # D200 - One-line docstring should fit on one line | ||
| 27 | # D402 - First line should not be the function's signature (bug in ruff 0.4.4) | ||
| 28 | # EM101 - Exception must not use a string literal, assign to variable first | ||
| 29 | # EM102 - Exception must not use an f-string literal, assign to variable first | ||
| 30 | # FBT003 - Boolean positional value in function call | ||
| 31 | # INP001 - File `tests/test_envtoolkit_instance_static.py` is part of an implicit namespace package. Add an `__init__.py`. | ||
| 32 | # PLR0912 - Too many branches | ||
| 33 | # PLR0913 - Too many arguments in function definition | ||
| 34 | # PLR0915 - Too many statements | ||
| 35 | # PLR2004 - Magic value used in comparison, consider replacing `X` with a constant variable | ||
| 36 | # PLW2901 - `for` loop variable `value` overwritten by assignment target | ||
| 37 | # S603 - `subprocess` call: check for execution of untrusted input | ||
| 38 | # T201 - `print` found | ||
| 39 | # TRY003 - Avoid specifying long messages outside the exception class | ||
| 40 | |||
| 41 | # Allow fix for all enabled rules (when `--fix`) is provided. | ||
| 42 | fixable = ["ALL"] | ||
| 43 | unfixable = [] | ||
| 44 | |||
| 45 | [format] | ||
| 46 | # Like Black, use double quotes for strings. | ||
| 47 | quote-style = "single" | ||
| 48 | |||
| 49 | # Like Black, indent with spaces, rather than tabs. | ||
| 50 | indent-style = "space" | ||
| 51 | |||
| 52 | # Like Black, respect magic trailing commas. | ||
| 53 | skip-magic-trailing-comma = true | ||
| 54 | |||
| 55 | # Like Black, automatically detect the appropriate line ending. | ||
| 56 | line-ending = "auto" | ||
| 57 | |||
| 58 | # Enable auto-formatting of code examples in docstrings. Markdown, | ||
| 59 | # reStructuredText code/literal blocks and doctests are all supported. | ||
| 60 | # | ||
| 61 | # This is currently disabled by default, but it is planned for this | ||
| 62 | # to be opt-out in the future. | ||
| 63 | docstring-code-format = false | ||
| 64 | |||
| 65 | # Set the line length limit used when formatting code snippets in | ||
| 66 | # docstrings. | ||
| 67 | # | ||
| 68 | # This only has an effect when the `docstring-code-format` setting is | ||
| 69 | # enabled. | ||
| 70 | docstring-code-line-length = "dynamic" | ||
| 71 | |||
| 72 | [lint.flake8-quotes] | ||
| 73 | inline-quotes = "single" | ||
