diff options
Diffstat (limited to '.ruff.toml')
| -rw-r--r-- | .ruff.toml | 47 |
1 files changed, 13 insertions, 34 deletions
| @@ -1,59 +1,40 @@ | |||
| 1 | cache-dir = "~/.cache/ruff" | 1 | cache-dir = "~/.cache/ruff" |
| 2 | indent-width = 4 | 2 | indent-width = 4 |
| 3 | line-length = 79 | 3 | line-length = 79 |
| 4 | target-version = "py312" | 4 | target-version = "py310" |
| 5 | namespace-packages = ["tests"] | ||
| 6 | |||
| 5 | 7 | ||
| 6 | [lint] | 8 | [lint] |
| 7 | select = ["ALL", "D101", "D102", "D103", "D104"] | 9 | select = ["ALL"] |
| 8 | ignore = [ | 10 | ignore = [ |
| 9 | "ANN", | ||
| 10 | "BLE001", | 11 | "BLE001", |
| 11 | "COM812", | 12 | "COM812", |
| 12 | "D", | 13 | "D2", |
| 14 | "D4", | ||
| 13 | "EM101", # Exception must not use a string literal, assign to variable first | 15 | "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 | 16 | "EM102", # Exception must not use an f-string literal, assign to variable first |
| 15 | "ERA001", | ||
| 16 | "FBT001", | ||
| 17 | "FBT002", | ||
| 18 | "INP001", | 17 | "INP001", |
| 19 | "ISC001", | ||
| 20 | "N802", | ||
| 21 | "N806", | ||
| 22 | "PLR2004", | ||
| 23 | "PTH111", | ||
| 24 | "RUF012", | ||
| 25 | "RUF013", | ||
| 26 | "S101", | 18 | "S101", |
| 27 | "S324", | 19 | "S324", |
| 28 | "T201", | 20 | "T201", |
| 29 | "TRY003", | 21 | "TRY003", |
| 30 | "TRY300", | ||
| 31 | "UP020" | ||
| 32 | ] | 22 | ] |
| 33 | 23 | ||
| 24 | # ARG005 - Unused lambda argument: `args` | ||
| 25 | # BLE001 - Do not catch blind exception: `Exception` | ||
| 34 | # D101 - Missing docstring in public class | 26 | # D101 - Missing docstring in public class |
| 35 | # D102 - Missing docstring in public method | 27 | # D102 - Missing docstring in public method |
| 36 | # D200 - One-line docstring should fit on one line | 28 | # E721 - Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks |
| 37 | # D203 - 1 blank line required before class docstring | 29 | # ERA001 - Found commented-out code |
| 38 | # D205 - 1 blank line required between summary line and description | ||
| 39 | # D403 - First word of the first line should be capitalized: `str` -> `Str` | ||
| 40 | # FBT001 - Boolean-typed positional argument in function definition | ||
| 41 | # FBT002 - Boolean default positional argument in function definition | ||
| 42 | # INP001 - File `beinc_weechat.py` is part of an implicit namespace package. Add an `__init__.py` | 30 | # INP001 - File `beinc_weechat.py` is part of an implicit namespace package. Add an `__init__.py` |
| 43 | # N802 - Function name `do_GET` should be lowercase | 31 | # PT008 - Use `return_value=` instead of patching with `lambda` |
| 44 | # N806 - Variable `POST_data` in function should be lowercase | ||
| 45 | # PLR2004 - Magic value used in comparison, consider replacing `200` with a constant variable | 32 | # PLR2004 - Magic value used in comparison, consider replacing `200` with a constant variable |
| 46 | # PTH111 - `os.path.expanduser()` should be replaced by `Path.expanduser()` | ||
| 47 | # PTH113 - `os.path.isfile()` should be replaced by `Path.is_file()` | ||
| 48 | # PTH123 - `open()` should be replaced by `Path.open()` | ||
| 49 | # RUF012 - Mutable class attributes should be annotated with `typing.ClassVar` | ||
| 50 | # RUF013 - PEP 484 prohibits implicit `Optional` | ||
| 51 | # S101 - Use of `assert` detected | 33 | # S101 - Use of `assert` detected |
| 52 | # S324 - Probable use of insecure hash functions in `hashlib`: `md5` | 34 | # S324 - Probable use of insecure hash functions in `hashlib`: `md5` |
| 53 | # T201 - `print` found | 35 | # T201 - `print` found |
| 54 | # TRY003 - Avoid specifying long messages outside the exception class | 36 | # TRY003 - Avoid specifying long messages outside the exception class |
| 55 | # TRY300 - Consider moving this statement to an `else` block | 37 | # TRY300 - Consider moving this statement to an `else` block |
| 56 | # UP020 - Use builtin `open` | ||
| 57 | 38 | ||
| 58 | # Allow fix for all enabled rules (when `--fix`) is provided. | 39 | # Allow fix for all enabled rules (when `--fix`) is provided. |
| 59 | fixable = ["ALL"] | 40 | fixable = ["ALL"] |
| @@ -61,7 +42,8 @@ unfixable = [] | |||
| 61 | 42 | ||
| 62 | # custom settings | 43 | # custom settings |
| 63 | [lint.per-file-ignores] | 44 | [lint.per-file-ignores] |
| 64 | "src/otp2289/__main__.py" = ["PTH113", "PTH123"] # "Readability counts" | 45 | "src/otp2289/generator.py" = ["ERA001"] # commented example code from RFC 2289 |
| 46 | # "tests/test_main.py" = ["ARG005", "E721", "PT008"] | ||
| 65 | 47 | ||
| 66 | 48 | ||
| 67 | [format] | 49 | [format] |
| @@ -93,6 +75,3 @@ docstring-code-line-length = "dynamic" | |||
| 93 | 75 | ||
| 94 | [lint.flake8-quotes] | 76 | [lint.flake8-quotes] |
| 95 | inline-quotes = "single" | 77 | inline-quotes = "single" |
| 96 | |||
| 97 | [lint.isort] | ||
| 98 | split-on-trailing-comma = false | ||
