feat(severity): add trivial + info levels

This commit is contained in:
claude
2026-08-21 23:58:57 +00:00
parent 2cf4bdbfe8
commit 23ec1bf74a
2 changed files with 59 additions and 3 deletions
+5 -3
View File
@@ -68,10 +68,11 @@ _SHA_MARKER_RE = re.compile(r"<!-- pragent:sha=([0-9a-f]{7,40}) -->")
AI_REVIEW_LABEL = "AI-REVIEW"
# Opt-in label for the token-usage block. Read at render time — see pr_has_label.
AI_USAGE_LABEL = "AI-USAGE"
SEVERITIES = ("critical", "high", "medium", "low")
SEVERITIES = ("critical", "high", "medium", "low", "trivial", "info")
# Severity rank — higher = more severe. Used by `apply_repo_config` to drop
# findings below `severity_threshold`. Critical=3, high=2, medium=1, low=0.
SEVERITY_RANK = {"low": 0, "medium": 1, "high": 2, "critical": 3}
# findings below `severity_threshold`. critical=4, high=3, medium=2, low=1,
# trivial=0, info=-1.
SEVERITY_RANK = {"info": -1, "trivial": 0, "low": 1, "medium": 2, "high": 3, "critical": 4}
REPO_CONFIG_FILE = ".pr-review.json"
# Style → (default max_findings, default severity_threshold). Strict is
@@ -957,6 +958,7 @@ _SEVERITY_EMOJI = {
"high": "🔴",
"medium": "🟡",
"low": "🔵",
"trivial": "",
"info": "",
"nit": "",
}