|
| 1 | +line-length = 120 |
| 2 | +target-version = "py37" |
| 3 | + |
| 4 | +[lint] |
| 5 | +select = [ |
| 6 | + "A", "B", "E", "F", "G", "I", "W", "N", "ASYNC", "C4", "COM", "FLY", "FURB", "ICN", "INT", "ISC", "LOG", |
| 7 | + "PERF", "PIE", "PLW", "PT", "PYI", "RET", "RSE", "RUF", "SIM", "TID", "TC", "UP", "YTT" |
| 8 | +] |
| 9 | +ignore = [ |
| 10 | + # Preview. Complaining about spaces (aligned arguments) should be a formatter option, not a linter one! |
| 11 | + # https://github.com/astral-sh/ruff/issues/2402 |
| 12 | + "E201", "E202", "E203", "E211", "E221", "E226", "E251", "E265", "E266", "E271", |
| 13 | + "E501", # A linter should lint, not check for line lengths! |
| 14 | + "F401", # Wants to from .version import __version__ as __version__ which clashes with pylint errors! |
| 15 | + "B904", |
| 16 | + "N801", # Some class names are snake_case to match ctypes |
| 17 | + "N803", # Argument names are camelCase instead of snake_case (400+ errors). |
| 18 | + "N806", # Variable names are camelCase instead of snake_case (1100+ errors). |
| 19 | + "N815", # Class-scope variable names are camelCase instead of snake_case (10 errors). |
| 20 | + "N816", # Global variable names are camelCase instead of snake_case (73 errors). |
| 21 | + "N999", # Module names are CamelCase like the classes they provide instead of snake_case (11 errors). |
| 22 | + "COM812", # Do not force trailing commas where it makes no sense, e.g., function calls for which I'll |
| 23 | + # never add more arguments. |
| 24 | + "PERF203", # Some code parts HAVE to try-except inside loops because only the element should be skipped, |
| 25 | + # not the whole loop being broken out of. Furthermore, this is a useless micro-optimization, |
| 26 | + # which is actually removed for Python 3.11+ which introduces zero-cost exceptions. |
| 27 | + "PLW0603", # Cannot live without global statements, especially for subprocessing. |
| 28 | + "PLW2901", # Only false positives for constructs such as for data in ...: data = data.clean(); process(data) |
| 29 | + "RET504", # https://github.com/astral-sh/ruff/issues/17292#issuecomment-3039232890 |
| 30 | + "RUF001", # Only false positives from tests with Unicode characters. |
| 31 | + "RUF039", # https://github.com/astral-sh/ruff/issues/18795 |
| 32 | + "RUF056", # "options.get('disableUnionMount', False):" Wants me to change False to None, |
| 33 | + # but it makes no sense semantically (expecting a bool) |
| 34 | + "RUF100", # BUG: removes necessary noqa: E402 in tests! |
| 35 | + "RUF012", # Mutable class attributes should be annotated with `typing.ClassVar`, but _fields_ is not mutable. |
| 36 | + |
| 37 | + "SIM102", |
| 38 | + "SIM105", |
| 39 | + "SIM115", # Too many locations where I do not know how to use context managers for files, |
| 40 | + # which are stored as object members for example! |
| 41 | + "TC006", # Wants to quote cast("IO[bytes]", ...) I don't agree with this style choice. |
| 42 | + "S101", "S110", "S105", "S311", "S324", "S603", "S607", "S608" |
| 43 | + |
| 44 | + # Bug: SIM118 removes the keys() from row.keys(), which is an sqlite3.Row not a Dict! |
| 45 | +] |
| 46 | +# Allow fix for all enabled rules (when `--fix`) is provided. |
| 47 | +fixable = ["ALL"] |
| 48 | +unfixable = [] |
| 49 | + |
| 50 | +[format] |
| 51 | +line-ending = "lf" |
| 52 | +quote-style = "preserve" |
| 53 | + |
0 commit comments