Suggesting rules
The bundled rulesets cover the common ground, but every repo has conventions no generic ruleset knows about. alint suggest closes that gap: it scans your working tree for evidence that a rule would have caught something, and proposes the bundled rulesets and rule entries that fit. It is review-only — it never edits your .alint.yml; you copy across what you agree with.
Think of it as the counterpart to alint init: init scaffolds from ecosystem markers (a Cargo.toml → the Rust ruleset), while suggest reasons from evidence in the tree (three console.log calls in src/ → a rule to forbid them).
The workflow
Section titled “The workflow”alint suggest # human-readable proposal tableRead the proposals, then adopt the ones you want — either by hand, or by piping the paste-ready snippet into your config and editing it down:
alint suggest --format yaml >> .alint.yml # then trim to what you acceptRe-run it periodically, or after onboarding a new area of the codebase, to catch conventions that have since accumulated evidence.
What it looks for
Section titled “What it looks for”Two kinds of signal, each shipping at a different confidence:
- Ecosystem markers → bundled rulesets (HIGH). A manifest or lockfile that maps to a bundled ruleset you don’t already extend — e.g. a
go.modpointing at thegoruleset. Deduplicated against your existingextends:unless you pass--include-bundled. - Antipatterns in the tree → specific rules (MEDIUM). Concrete residue a rule would catch, for example:
console.log/console.debugcalls in production source → a rule that forbids them..bakfiles and scratch docs sitting at the repo root →file_absentrules.- TODO/FIXME markers older than 180 days → a
git_blame_agerule that surfaces stale debt.
Each proposal carries its evidence (3 console.log calls in src/), so you can judge it at a glance.
Confidence
Section titled “Confidence”--confidence <low|medium|high> sets the lower bound on signal strength:
alint suggest --confidence high # only the strongest signals (ecosystem-marker hits)alint suggest --confidence low # broadest; useful when prospecting, but noisierThe default floor is medium — low-confidence hits are prospecting aids, not recommendations, so they stay hidden unless you ask. Proposals print in deterministic order (by confidence, then id), so the same tree always yields the same output.
Output
Section titled “Output”- human (default) — a grouped, colorized proposal table.
--format yaml— a paste-ready.alint.ymlsnippet, header-commented with the scan timestamp and a “review each rule before adopting” reminder.--format json— a stable{ proposals: [{ id, kind, evidence, confidence }, … ] }shape for agent consumption.--explain— print one-line, file-level evidence under each proposal so a reviewer can decide quickly.--include-bundled— also suggest bundled rulesets you already extend (off by default, since you presumably adopted those deliberately).
Progress on a large tree renders on stderr (--progress / --quiet control it); a --format json payload on stdout stays byte-clean.
What it does not do
Section titled “What it does not do”suggest never writes to your config — every output is review-only, so a scan can’t surprise you with a rule you didn’t vet. It also doesn’t run the proposed rules against your tree; it proposes what would help, and you decide. Once you’ve adopted rules on an established repo, pair it with baseline mode to grandfather the existing violations and gate only on new ones.
See also
Section titled “See also”alint suggestCLI reference — every flag, captured from the binary- Baseline mode — adopting on a repo with existing debt
- Rules — the bundled rulesets and rule kinds
suggestproposes