-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathruff.toml
More file actions
81 lines (75 loc) · 2.81 KB
/
ruff.toml
File metadata and controls
81 lines (75 loc) · 2.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
target-version = "py310"
lint.select = [
"ALL",
]
lint.extend-ignore = [
# Later (or never)
"CPY", # Copyright
"TD",
"ERA",
# False positive
"S101", # Use of `assert` detected
"D203", # one-blank-line-before-class
"D213", # multi-line-summary-second-line
"COM812", # ...
"T201", # Print...
"SIM117", # Nested `with` statements (this is a fundamental pattern in Textual)
# Subprocess - needed
"S603", # subprocess call - intentional for $EDITOR
"S607", # start-process-with-partial-path
"S606", # start-process-with-no-shell
# Fix later (or not)
"FBT001", # Boolean positional arg - common in widget/Textual APIs
"FBT002", # Boolean default arg - common in widget/Textual APIs
"FBT003", # Boolean positional value - common with reactive()
"ARG002", # Unused argument - common in watch methods/event handlers
"PLR0913", # Too many arguments - export functions need them
"BLE001", # Blind exception - acceptable for user-facing error handling
"SLF001", # Private member access - accessing own class's private attrs
"PLW2901", # Loop variable overwritten - common strip() pattern
"ANN003", # Missing **kwargs annotation - common in widget subclasses
"ANN001", # Missing arg annotation - event handlers
"PTH108", # os.unlink -> Path.unlink - contextlib.suppress pattern
"PTH123", # open() -> Path.open() - binary file writing
"S110", # try-except-pass - acceptable for config loading with defaults
"PLW0603", # global statement - used for singleton config/state
"TRY300", # return in try block - cleaner for import checks
"PERF401", # list comprehension - explicit append loop is clearer
"RUF003",
"E501",
"TRY301", # raise-within-try
"SIM108", # Use ternary operator
"PLR2004", # magic-value-comparison
"PERF203", # try-except-in-loop
]
[lint.extend-per-file-ignores]
"tests/**/*.py" = [
"BLE001", # blind-except
"D",
"DOC",
"ANN",
"PLR2004",
"INP001",
"PLC0415", # runtime imports for optional dependencies
"E501", # line too long in test assertions
"N802", # naming
]
"src/prezo/export.py" = [
"E501", # Line too long - embedded CSS URLs in SVG template
]
"src/prezo/images/*.py" = [
"PLC0415", # Lazy imports for optional dependencies (PIL, libsixel)
"E501", # Long character set strings
"C901", # Complex sixel encoder - follows protocol specification
]
"src/prezo/widgets/*.py" = [
"A002", # id is a common parameter name in Textual widgets
]
"src/prezo/config.py" = [
"C901", # Complex update_from_dict - intentionally verbose for clarity
"PLR0912", # Many branches in update_from_dict - covers all config sections
]
[lint.isort]
combine-as-imports = true
required-imports = ["from __future__ import annotations"]
known-first-party = ["prezo"]