diff options
| author | Simeon Simeonov | 2025-07-02 20:58:43 +0200 |
|---|---|---|
| committer | Simeon Simeonov | 2025-07-02 20:58:43 +0200 |
| commit | 29817dfd24ca5b2536eb14aaadd84d3cbded7a32 (patch) | |
| tree | f555340bfce16c8ffd70ee3bad8348d1f1fdd6ad /.ruff.toml | |
| parent | 76c02cdbbec34c37795bc378dee4cb3249939c48 (diff) | |
Diffstat (limited to '.ruff.toml')
| -rw-r--r-- | .ruff.toml | 96 |
1 files changed, 96 insertions, 0 deletions
diff --git a/.ruff.toml b/.ruff.toml new file mode 100644 index 0000000..12d671b --- /dev/null +++ b/.ruff.toml | |||
| @@ -0,0 +1,96 @@ | |||
| 1 | cache-dir = "~/.cache/ruff" | ||
| 2 | indent-width = 4 | ||
| 3 | line-length = 79 | ||
| 4 | target-version = "py311" | ||
| 5 | |||
| 6 | [lint] | ||
| 7 | select = ["ALL", "D101", "D102", "D103", "D104"] | ||
| 8 | ignore = [ | ||
| 9 | "ANN", | ||
| 10 | "BLE001", | ||
| 11 | "COM812", | ||
| 12 | "D", | ||
| 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 | "ERA001", | ||
| 16 | #"FBT001", | ||
| 17 | #"FBT002", | ||
| 18 | #"INP001", | ||
| 19 | #"ISC001", | ||
| 20 | #"N802", | ||
| 21 | #"N806", | ||
| 22 | "PLR2004", | ||
| 23 | "PTH111", | ||
| 24 | "PTH123", | ||
| 25 | "RUF012", | ||
| 26 | #"RUF013", | ||
| 27 | #"S101", | ||
| 28 | "S308", | ||
| 29 | "S603", | ||
| 30 | "T201", | ||
| 31 | "TRY003", | ||
| 32 | "TRY300", | ||
| 33 | #"UP020" | ||
| 34 | ] | ||
| 35 | |||
| 36 | # D101 - Missing docstring in public class | ||
| 37 | # D102 - Missing docstring in public method | ||
| 38 | # D200 - One-line docstring should fit on one line | ||
| 39 | # D203 - 1 blank line required before class docstring | ||
| 40 | # D205 - 1 blank line required between summary line and description | ||
| 41 | # D403 - First word of the first line should be capitalized: `str` -> `Str` | ||
| 42 | # ERA001 - Found commented-out code | ||
| 43 | # FBT001 - Boolean-typed positional argument in function definition | ||
| 44 | # FBT002 - Boolean default positional argument in function definition | ||
| 45 | # INP001 - File `beinc_weechat.py` is part of an implicit namespace package. Add an `__init__.py` | ||
| 46 | # N802 - Function name `do_GET` should be lowercase | ||
| 47 | # N806 - Variable `POST_data` in function should be lowercase | ||
| 48 | # PTH111 - `os.path.expanduser()` should be replaced by `Path.expanduser()` | ||
| 49 | # PTH123 - `open()` should be replaced by `Path.open()` | ||
| 50 | # PLR2004 - Magic value used in comparison, consider replacing `200` with a constant variable | ||
| 51 | # RUF012 - Mutable class attributes should be annotated with `typing.ClassVar` | ||
| 52 | # RUF013 - PEP 484 prohibits implicit `Optional` | ||
| 53 | # S101 - Use of `assert` detected | ||
| 54 | # S308 - Use of `mark_safe` may expose cross-site scripting vulnerabilities | ||
| 55 | # S603 - `subprocess` call: check for execution of untrusted input | ||
| 56 | # T201 - `print` found | ||
| 57 | # TRY003 - Avoid specifying long messages outside the exception class | ||
| 58 | # TRY300 - Consider moving this statement to an `else` block | ||
| 59 | # UP020 - Use builtin `open` | ||
| 60 | |||
| 61 | # Allow fix for all enabled rules (when `--fix`) is provided. | ||
| 62 | fixable = ["ALL"] | ||
| 63 | unfixable = [] | ||
| 64 | |||
| 65 | [format] | ||
| 66 | # Like Black, use double quotes for strings. | ||
| 67 | quote-style = "single" | ||
| 68 | |||
| 69 | # Like Black, indent with spaces, rather than tabs. | ||
| 70 | indent-style = "space" | ||
| 71 | |||
| 72 | # Like Black, respect magic trailing commas. | ||
| 73 | skip-magic-trailing-comma = true | ||
| 74 | |||
| 75 | # Like Black, automatically detect the appropriate line ending. | ||
| 76 | line-ending = "lf" | ||
| 77 | |||
| 78 | # Enable auto-formatting of code examples in docstrings. Markdown, | ||
| 79 | # reStructuredText code/literal blocks and doctests are all supported. | ||
| 80 | # | ||
| 81 | # This is currently disabled by default, but it is planned for this | ||
| 82 | # to be opt-out in the future. | ||
| 83 | docstring-code-format = false | ||
| 84 | |||
| 85 | # Set the line length limit used when formatting code snippets in | ||
| 86 | # docstrings. | ||
| 87 | # | ||
| 88 | # This only has an effect when the `docstring-code-format` setting is | ||
| 89 | # enabled. | ||
| 90 | docstring-code-line-length = "dynamic" | ||
| 91 | |||
| 92 | [lint.flake8-quotes] | ||
| 93 | inline-quotes = "single" | ||
| 94 | |||
| 95 | [lint.isort] | ||
| 96 | split-on-trailing-comma = false | ||
