-
Notifications
You must be signed in to change notification settings - Fork 90
Expand file tree
/
Copy path.ruff.toml
More file actions
69 lines (63 loc) · 3.57 KB
/
Copy path.ruff.toml
File metadata and controls
69 lines (63 loc) · 3.57 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
# Ruff configuration
target-version = "py311"
line-length = 100
src = ["aTrain", "aTrain_core"]
extend-exclude = [
".venv",
"build",
"dist",
"aTrain.egg-info",
"aTrain_core.egg-info",
"aTrain/required_models",
]
[lint]
select = [
"E", "F", "W", # pycodestyle / pyflakes
"I", # isort
"B", # bugbear
"UP", # pyupgrade
"SIM", # simplify
"RUF", # ruff-specific
"S", # bandit-style security checks
"RET", # return-statement quality
"C4", # comprehensions
"A", # builtin shadowing
"N", # naming
]
ignore = [
"E501", # line length is the formatter's job, not the linter's
"S603", # subprocess: aTrain calls xdg-open with a static argv, not a shell
"RET504", # named intermediate variables serve as in-line documentation
"SIM105", # try/except <exc>: pass is idiomatic, contextlib.suppress is a style preference (not a safety win)
]
[lint.per-file-ignores]
"aTrain/__init__.py" = ["N999"] # project name aTrain intentionally capitalised
"aTrain/__main__.py" = ["N999"] # project name aTrain intentionally capitalised
"aTrain/pages/**/*.py" = ["SIM117"] # NiceGUI: nested `with` reflects the UI tree
"aTrain/components/**/*.py" = ["SIM117"] # NiceGUI: nested `with` reflects the UI tree
"tests/**" = ["S101", "S607"] # pytest asserts; tests invoke aTrain/aTrain_core by name
# --- Grandfathered findings that need a manual (non-auto-fixable) code
# change. Deferred to small, focused follow-up PRs so the behaviour change
# is reviewable alongside test coverage (per review on #160). Each entry
# is removed in the PR that applies the corresponding fix.
"aTrain/components/settings/advanced.py" = ["A002"] # `open` param shadows builtin
"aTrain/components/settings/model.py" = ["A001"] # `input` var shadows builtin
"aTrain/components/settings/speaker_count.py" = ["A001"] # `input` var shadows builtin
"aTrain/components/settings/speaker_detection.py" = ["A001"] # `input` var shadows builtin
"aTrain/components/settings/language.py" = ["RUF015"] # list(d.keys())[0] -> next(iter(d))
"aTrain/components/splash_screen.py" = ["SIM118"] # `in d.keys()` -> `in d`
"aTrain/utils/models.py" = ["B904", "SIM118"] # raise ... from; in d.keys()
"aTrain/utils/archive.py" = ["S607"] # partial exe path for xdg-open
# --- aTrain_core grandfathered findings (imported via the #145 monorepo
# merge). Same rationale as the aTrain block above: defer the manual fixes
# to small focused PRs so the behaviour change is reviewable. Each entry
# is removed in the PR that applies the corresponding fix.
"aTrain_core/__init__.py" = ["N999"] # project name aTrain_core intentionally capitalised
"aTrain_core/__main__.py" = ["N999"] # project name aTrain_core intentionally capitalised
"aTrain_core/load_resources.py" = ["N801", "B026"] # class `custom_tqdm` lowercase; super().__init__(total=total, *args) star-after-kwarg
"aTrain_core/transcribe.py" = ["E402", "B904", "N803", "N806", "B006", "SIM108", "SIM118", "SIM211"] # late module imports after warnings.filterwarnings; raise without `from`; `returnDict` camelCase; mutable {} default; chained-if/elif; `.keys()`; double-negation
"aTrain_core/outputs.py" = ["SIM401"] # if-expr instead of dict.get default
"aTrain_core/settings.py" = ["RET503"] # implicit None return on one branch
[format]
quote-style = "double"
indent-style = "space"