Repository navigation
Expand file tree
/
Copy pathpython.quality.toml
More file actions
104 lines (92 loc) · 3.62 KB
/
Copy pathpython.quality.toml
File metadata and controls
104 lines (92 loc) · 3.62 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
# code-quality config, Python. Copy to <repo>/.quality.toml, then
# bun ~/.claude/skills/code-quality/scripts/quality.ts install-hooks <repo>
# Blocks: Radon CRAP, pycycle, vulture, Ruff, OSV. Install:
# uv tool install pycycle vulture ruff radon
# brew install osv-scanner
[project]
language = "py"
src = ["src", "scripts"]
# Leave base out to detect it from origin/HEAD (then origin/main, origin/master, main).
base = "origin/main"
# out_dir = ".scratch/quality" # every report, the baseline, allow.md and the logs
# tools_dir = "~/.cache/quality-gate"
# Full gate (quality.ts without a command). Must write lcov to $QG_LCOV.
test_cmd = 'uv run --with pytest --with pytest-cov pytest -q --cov=src --cov=scripts --cov-report=lcov:"$QG_LCOV"'
[thresholds]
# One bar for every repo. Listed here so a reader sees them next to the rules.
max_cc = 10
max_crap = 30
# Diagnostic warning threshold. It never changes the gate exit code.
max_mean_crap = 5
mean_tolerance = 0.01
cognitive_complexity = 15
max_depth = 4
max_params = 4
max_lines_per_function = 80
dup_min_tokens = 70
diff_coverage = 0.8
min_release_age_days = 1
[layers]
# Application code must not import the tooling scripts.
forbid = ["^src/:^scripts/"]
[knip]
ignore = ["tests/**", "scripts/fixtures/**"]
[glossary]
path = "CONTEXT.md"
marker = "_Avoid_:"
# allow = plain-line words that are still homonyms in this repo.
allow = ["cron", "override", "job"]
globs = ["README.md", "AGENTS.md", "CONTEXT.md", "CONTRIBUTING.md", "docs/**/*.md", "src/**/*.md"]
commit_msg = true
[docs]
globs = ["README.md", "AGENTS.md", "CONTEXT.md", "CONTRIBUTING.md", "SECURITY.md", "docs/**/*.md"]
# ADRs and changelogs record removals: symbols and paths they name may be gone on purpose.
history_globs = ["docs/adr/**", "CHANGELOG.md", "**/CHANGELOG.md"]
[secrets]
allow_users = ["deploy", "ci"]
[security]
gitleaks = true
audit = true
# Registry per ecosystem for deps/lock-age: point one at a mirror, or "" to skip that ecosystem.
# Known ids: npm, pypi, crates, go, rubygems, packagist, pub, nuget, maven, deps.dev.
# registry_urls = { npm = "https://mirror.local/npm/{name}" }
[escalate]
paths = ["**/*auth*", "**/*security*", "docs/adr/**"]
[hooks]
pre_push_test_cmd = "uv run --with pytest pytest -q {files}"
pre_push_timeout = 180
pre_push_max_tests = 40
[tools]
# Overrides for the pinned external tools (ids in scripts/lib/tools.ts). A bare value is a version,
# a value with a path separator a binary path. Unknown ids are a config error.
# jscpd = "5.3.0"
# gitleaks = "/opt/bin/gitleaks"
[review]
# Jev notes on added test hunks: notes only, never block. The key comes from the provider:
# auto takes TYPESAFE_API_KEY, else OPENROUTER_API_KEY.
jev = true
jev_provider = "auto"
# jev_url / jev_key_env / jev_model override the provider defaults (required for jev_provider = "custom").
jev_max_states = 12
textual_test = true
textual_test_threshold = 0.85
error_path_tested = true
error_path_tested_threshold = 0.5
assertion_weakened = true
assertion_weakened_threshold = 0.7
mock_hides_behavior = true
mock_hides_behavior_threshold = 0.7
property_is_tautology = true
property_tautology_threshold = 0.7
# Changed source hunks: is the change tested in this diff (a note below the threshold).
change_untested = true
change_untested_threshold = 0.5
# The task spec, a path in the repo; empty = $QG_SPEC; neither = "jev: spec not set".
# spec = "docs/specs/task.md"
spec_incomplete = true
spec_incomplete_threshold = 0.7
# Agent pack for AI assistant and agent code: code globs and prompt/instruction globs; empty = off.
# agent_globs = ["agent/**/*.py"]
# agent_prompt_globs = ["agent/prompts/**/*.md"]
agent_threshold = 0.7
llm = false