Tuning severities¶
Every check ships with a default severity, but every shop weighs ST
changes differently. Use .plc-st-review.yml at your repo root to
override.
Three things you can do¶
1. Pin a category to a specific severity¶
Effects:
- The runtime severity is replaced wholesale (even for checks like
TIMER_VALUE_CHANGED that normally vary by magnitude).
- severity_overrides runs before reporting.fail_on_severity, so
pinning a check to error is a quick way to make it merge-blocking.
2. Disable a category entirely¶
The engine never runs disabled checks, so they cost nothing.
3. Adjust safety-critical detection¶
CONSTANT_VALUE_CHANGED elevates info → warn for any constant
whose name starts with a configured prefix. Tune for your shop's
naming convention:
Two failure thresholds you can set¶
fail_on_severitycontrols when the CLI / CI job exits non-zero. In GitLab/GitHub modes the comment posting still runs to completion regardless of the exit code.comment_style: summaryforces the GitLab/GitHub poster to skip inline comments and post a single summary table. Useful when the signal-to-noise is bad in early adoption and you want to look at the whole picture in one place.
Tuning over time¶
A pragmatic ramp:
- Week 1: install with all defaults,
fail_on_severity: error. Watch what fires on real MRs. - Week 2: disable any check that's consistently noisy (often
COMMENT_ONLYandPRAGMA_CHANGED). - Week 3: promote any
warnyour team always wants to block merge, typicallyTIMER_VALUE_CHANGEDfor safety-touched code. - Steady state: revisit the config when team feedback collects. The config is intentionally small so re-tuning is cheap.
Baselining an existing repo¶
If you adopt plc-st-review mid-project, the first run can light up
with findings about long-shipped code. Two options:
- Run once with
--output json --out-file baseline.json, commitbaseline.json, and (in a future release) point the CLI at it via--baseline baseline.jsonso prior findings are filtered out. - Or: temporarily set
reporting.fail_on_severity: errorplusseverity_overridesthat promote only the categories you care most about. Tighten as the codebase catches up.