Repository navigation
Expand file tree
/
Copy pathruff.toml
More file actions
105 lines (99 loc) · 3.04 KB
/
Copy pathruff.toml
File metadata and controls
105 lines (99 loc) · 3.04 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# Docs: https://docs.astral.sh/ruff/configuration/
line-length = 120
# Scripts outside dot/ carry no requires-python to infer the target from.
target-version = "py314"
# Skill templates hold scaffolds with <placeholder> tokens that are not valid Python;
# every other skill script is linted like first-party code.
# dprint owns Markdown, including the Python blocks inside it.
# dot_config/ruff/ruff.toml is a deployed user config with no Python sources; excluding it prevents Ruff from initializing dot_config/ruff/.ruff_cache/.
extend-exclude = [
"dot_config/ruff",
"skills/*/templates",
"skills/*/references/*/templates",
"*.md",
]
force-exclude = true
[per-file-target-version]
# agy runs these scripts with the first python3 on PATH, possibly an older system one.
"private_dot_gemini/private_antigravity-cli/display.py" = "py39"
"private_dot_gemini/private_antigravity-cli/guard.py" = "py39"
[format]
docstring-code-format = true
line-ending = "lf"
[lint]
select = [
"A",
"ANN",
"ARG",
"ASYNC",
"B",
"BLE",
"C4",
"C90",
"COM818", # accidental trailing comma creating a 1-tuple (formatter-safe subset of COM)
"DTZ",
"E",
"ERA",
"F",
"FURB",
"G",
"I",
"ICN",
"ISC",
"LOG",
"N",
"PERF",
"PGH",
"PIE",
"PLC",
"PLE",
"PLR",
"PLW", # Pylint warnings (notably PLW1510: subprocess.run without check)
"PT",
"PTH",
"PYI",
"RET",
"RSE",
"RUF",
"S",
"SIM",
"SLF",
"SLOT",
"T10",
"T20",
"TID",
"TRY002", # avoid raising vanilla Exception
"TRY201", # bare raise inside except
"TRY203", # remove useless try/except that only re-raises
"TRY400", # prefer logger.exception inside except
"TRY401", # avoid repeating the exception object in logger.exception
"UP",
"W",
"YTT",
]
ignore = [
"ANN401", # allow explicit Any at dynamic and wire boundaries
"E501", # line length allowed for long URLs, strings, and templates
"PLC0415", # allow lazy local imports inside CLI commands and helpers
"PLR0911", # allow flat guard-clause early returns
"PLR0913", # allow explicit keyword parameters without wrapper objects
"PLR0917", # allow positional arguments when natural
"PLR2004", # allow literal thresholds, exit codes, and HTTP status codes
"PLW0108", # unnecessary-lambda: style, outside Ruff's default set
"PLW2901", # redefined-loop-name: deliberate rebinding, outside Ruff's default set
]
[lint.mccabe]
max-complexity = 12
[lint.per-file-ignores]
"**/tests/**" = [
"ANN", # test helpers and fixtures need not carry full type annotations
"PLR0915", # multi-step arrange/act/assert integration tests
"S101", # assert statements allowed in test assertions
"S603", # trusted subprocess calls in test fixtures
"S607", # executable names without absolute paths in test subprocess calls
"SLF001", # unit tests exercise internal helpers
]
# Test-only templates checked with --no-force-exclude in test_cli_templates.py inherit tests/** ignores.
"skills/python/references/testing/templates/**" = ["S101", "S603", "S607"]
[lint.isort]
known-first-party = ["dot_tasks", "fmind_dot", "repo_helpers"]