Field guide

Code style and static analysis: enforce the rules early

Style and type defects should reach the author before expensive review.

engineering-standards

All field guidesView the source on GitHub

Style and type defects should reach the author before expensive review. Put the rules in repository-owned commands, return quick feedback after edits, and reject failing source snapshots before delivery.

Audience: engineers and technical leads setting standards for maintained code, including code written by agents.

Skill: none yet.

This page defines engineering policy. Tool choices are recommended defaults; keep justified existing choices. Timing targets are adoption targets, not measured results. This page supplies no hook implementation and claims no production outcomes. All examples are synthetic.

Sources

Primary documentation consulted on 2026-11-26. Check the documentation and help for the pinned tool version before copying a command.

At a glance

Diagram: Repository: pinned tools, rules, scope, Edit: quick file feedback, Commit: check staged snapshot, Full static gate: local and CI, Review: behaviour and design Repository: pinned tools, rules, scope Edit: quick file feedback Commit: check staged snapshot Full static gate: local and CI Review: behaviour and design

Takeaway: the repository owns the rules; each layer checks a declared scope, and the full gate covers edits that bypass hooks.

CheckQuestion it answersLimit
FormatterDoes layout match the chosen style?Does not prove correctness
LinterDoes code violate selected static rules?Only enabled rules and inspected files are covered
Type or compile checkIs code consistent with types and build context?Does not prove runtime behaviour
Architecture checkDo dependencies obey component boundaries?Needs explicit boundary rules
TestDoes executed behaviour meet the contract?Static checks remain necessary

Decision guide

Define the repository contract

Record the following beside the repository’s gate instructions:

FieldRequired detail
OwnerWho reviews rule changes, exclusions, and exceptions
ToolsOne owner per formatting, linting, and typing responsibility; compatible pinned versions
RuntimeSupported language, SDK, compiler, and operating-system versions
CommandsExplicit repair command, fast check, staged check, and full non-mutating static gate
ScopeMaintained source, tests, scripts, hooks, configuration, and nested packages
ExclusionsGenerated, vendor, build output, and immutable files; name their validation owner
SeverityWhich diagnostics block delivery, including warnings
DebtReviewed baseline mechanism, owner, reason, and review date

Preserve working tools and the existing hook manager. A manager schedules commands; it does not define another set of rules. Keep formatting rules out of a linter when they conflict with the formatter. Pin plugins and build integrations as well as the executable. Bootstrap dependencies explicitly before enabling offline hooks.

A configuration file is insufficient evidence of enforcement. Verify the invocation, inspected scope, exit status, hook activation, and required CI result. A script named lint needs a working configuration and a caller.

Prefer manifest-owned lint levels when supported. Rust workspaces can define [workspace.lints.clippy]; member packages must opt into inheritance with [lints] workspace = true. Keep thresholds and the minimum supported Rust version (MSRV) in the appropriate Clippy configuration. Set the MSRV so supported checks avoid suggestions requiring a newer runtime.

The matching paths above cover dedicated check configurations at the root and in nested packages. General manifests such as pyproject.toml, Cargo.toml, and tsconfig.json also contain unrelated settings, so they are not automatic path triggers here. Review their static-check changes under this page’s applies_when criteria.

Keep diagnostics useful

Measure the effective false-positive rate: the share of reviewed diagnostics authors judge unhelpful or unactionable, including technically valid findings with unclear value. Sample author decisions per rule; distinguish justified exceptions from misunderstandings and inspect recurring suppressions.

As an initial policy, target below 10% per review-time rule and below 5% overall, drawing on Google’s deployment experience. These are adoption targets, not universal tool accuracy guarantees. Security triage can use a separate reviewed tolerance for high-impact findings. Demote or repair noisy rules before making them blocking. Explain the risk and give a concrete repair or safe suggestion with each diagnostic; an opaque rule ID is insufficient.

Choose a language baseline

Required means deterministic formatting and zero unsuppressed diagnostics at the chosen blocking severity. Ratchet permits reviewed existing debt, rejects new debt, and requires removal of resolved allowances. Selective means enabling rules with demonstrated value for the maintained code. These levels can apply to different parts of the same language policy.

Language or artifactFormatterLint or analysisType or compile checkStrictness
PythonRuff formatRuff check with E4,E7,E9,F,I,B,UP,RUF100, adjusted for runtimeOne of mypy or Pyright with project configurationRequired format/lint; strict new packages; ratchet legacy types
TypeScript / TSXPrettierESLint recommended TypeScript/React rules; type-aware rules at project scopetsc --noEmit or build mode for project referencesRequired strict; ratchet additional unchecked-index and optional-property checks
JavaScript / Astro / MDX / CSSPrettier with required parsers/pluginsESLint JS/React/Astro where applicable; deliberate CSS/prose rulesAstro checker for .astro; TypeScript for typed modules; selective checkJsRequired configured checks; selective JS typing
Kotlin / Gradle Kotlin DSLktlintDetekt standard bug/coroutine rules and selected complexity/domain rulesKotlin compilation through the buildRequired new-code style; ratchet legacy debt; warnings as errors after inventory
Javagoogle-java-format or palantir-java-formatCheckstyle for non-conflicting style rules and selected Error Prone compile-time bug checksProject compilation; selected compiler warnings with -Werror after measuring debtRequired formatter/compiler; selective complementary analysis; ratchet warnings
ScalascalafmtSelected Scalafix semantic rulesScala compiler through the supported buildRequired formatting/types; selective semantic rules without forced compiler upgrades
RustrustfmtClippyClippy includes type/borrow checking; cargo check for additional target/feature combinationsRequired formatting and selected Clippy warnings as errors; ratchet legacy debt
Gogofmt or configured golangci-lint formattersgo vet plus staticcheck, or golangci-lint configured to own bothgo build for supported packages/targetsRequired formatting/vet/build; selective extra rules
C / C++clang-formatclang-tidy with the real compilation databaseSupported compiler/build targetsRequired format/build; selective tidy rules and warnings; ratchet legacy debt
SwiftBundled swift format on Swift 6+, or pinned standalone swift-formatSwiftLint with overlapping format rules disabledSwift package or Xcode project buildRequired format/build; selected blocking lint; ratchet debt
C# / .NETdotnet formatRoslyn analyzers configured in the project and .editorconfigdotnet build with reviewed warnings as errorsRequired formatting/build; ratchet existing warnings before enforcing the chosen set
RubyRuboCop layout rulesRuboCop lint and selected style rulesruby -c checks syntax; keep an existing Sorbet/Steep check if adoptedRequired selected cops and syntax; Ruby syntax is not static typing
Dart / Flutterdart formatdart analyze --fatal-infos or flutter analyze with explicit analysis_options.yamlAnalyzer plus target build where requiredRequired diagnostics including selected info-level lints; ratchet only with a reviewed mechanism
ShellshfmtShellCheck after shell syntax checkbash -n for Bash; use the declared shell for other dialectsRequired errors/warnings; narrow reasoned suppressions
MarkdownExisting formatter optionalmarkdownlint-cli2; narrow prose and link checksNot applicableRequired structural rules; selective line length and HTML exceptions
JSON / YAML / workflowsExisting formatterSchema validation; actionlint and authorized offline zizmor for workflowsReal consumer validation where practicalRequired syntax/schema; selected security rules
SQLSQLFluff with actual dialect and templaterSQLFluff parse/basic rules; selected style rulesExisting schema/migration validationRequired parse/basic rules; applied migrations stay immutable
Terraformterraform fmt -check -recursiveterraform validate per maintained module; optional configured TFLintValidation after explicit dependency preparationRequired native checks; selective provider rules
OpenAPI / GraphQLExisting formatterAdopted Spectral/Redocly rules; GraphQL schema/document validationExisting generated-contract and drift checksRequired contract validity and drift checks
Protocol BuffersAdopted formatter or Buf formatSelected Buf lint rules for owned schemasExisting protoc and generated-binding checksRequired owned contract checks; compatibility only for real consumer promises

Operational scripts and hooks need deliberate coverage. Set Python’s target version to the oldest supported interpreter. Exclude generated code from hand-formatting; retain generator validation and drift checks. Do not force strict typing onto generated JavaScript merely to match maintained sources.

Keep Ruff’s indentation rules (E111, E114, E117) disabled when Ruff format owns layout. Add E501 only as a deliberate policy: the formatter cannot wrap every long comment or string. If Prettier and ESLint exceed the edit budget, evaluate alternatives such as Biome or Oxlint against the required parser, plugin, and rule coverage before replacing working tools. A faster executable does not establish equivalent coverage.

Separate file feedback from project checks

The examples below assume pinned dependencies are already available. Paths, project names, build tasks, and executables are synthetic placeholders to replace with repository-owned selections. A “full gate” cell lists operations the repository’s static command must perform; semicolons separate operations in prose, not a fail-safe shell implementation. No row is an install recipe.

LanguageFast per-file feedbackFull gate operations
Pythonruff format --check src/sample.py; ruff check src/sample.pyRuff format/check on maintained roots; configured mypy or Pyright project
TypeScript / JavaScriptprettier --check src/sample.ts; eslint --max-warnings 0 src/sample.ts when warnings blockPrettier and ESLint with the same warning policy on maintained roots; tsc --noEmit -p tsconfig.json or configured reference build; astro check --minimumFailingSeverity warning when warnings block
KotlinPinned ktlint src/Sample.kt in check modeBuild-owned ktlint check and Detekt tasks; affected compilation and dependency closure, full required modules in CI
Javagoogle-java-format --dry-run --set-exit-if-changed src/Sample.javaFormatter on maintained Java; configured Checkstyle/Error Prone tasks; build-owned compiler with reviewed -Xlint and -Werror policy
ScalaPinned scalafmt --test src/Sample.scalasbt scalafmtCheckAll scalafmtSbtCheck; configured Scalafix check and compile tasks; supported scalafmtCheckRepo for scripts outside build roots
Rustrustfmt --check --edition <project-edition> src/sample.rs, replacing the placeholder with the configured editioncargo fmt --all --check; cargo clippy --workspace --all-targets --locked --offline -- -D warnings; cargo check only for additional supported target/feature combinations
Gogofmt -l sample.go; wrapper rejects nonempty outputgofmt with nonempty-output rejection, go vet ./..., and staticcheck ./...; alternatively configured golangci-lint fmt --diff and golangci-lint run; go build ./...
C / C++clang-format --dry-run --Werror src/sample.cpp; clang-tidy -p build --warnings-as-errors='*' src/sample.cpp if within budgetclang-format checks on maintained sources/headers; run-clang-tidy -p build with configured WarningsAsErrors and owned-header coverage; configured build targets
Swiftswift format lint --strict Sources/Sample.swift; swiftlint lint --strict Sources/Sample.swift for the pinned CLIswift format lint --strict --recursive Sources Tests; configured swiftlint lint --strict; swift build or the required Xcode build
C# / .NETdotnet format whitespace App.sln --include src/Sample.cs --verify-no-changes --no-restore if within budgetdotnet format App.sln --verify-no-changes --no-restore --severity info when info-level rules block; dotnet build App.sln --no-restore -warnaserror with configured Roslyn analyzers and style enforcement
Rubybundle exec rubocop --raise-cop-error lib/sample.rb; ruby -c lib/sample.rbbundle exec rubocop --raise-cop-error --report-unused-todo-entries; syntax checks for maintained Ruby; existing project type checker if present
Dartdart format --output=none --set-exit-if-changed lib/sample.dartSame format check on maintained roots; project dart analyze --fatal-infos or flutter analyze with its default fatal-info policy retained
Shellbash -n scripts/sample.sh; shfmt -d scripts/sample.sh; shellcheck -x -S warning scripts/sample.sh for blocking warnings/errorsSyntax, shfmt and source-aware ShellCheck with the same severity policy on maintained scripts and declared shell dialects

File formatters need the same configuration as the full gate. A standalone Rust formatter must use the project edition and configuration; it is not a substitute for workspace checking. Select supported Cargo feature combinations and targets explicitly. Do not enable every feature when features conflict. clang-tidy needs the real include paths, defines, and compiler flags from compile_commands.json; header changes expand to affected translation units. Set HeaderFilterRegex or --header-filter to include owned headers. The warnings-as-errors setting changes severity; it does not enable missing checks. Bound the worker count for run-clang-tidy to the gate’s resource budget.

For TypeScript project references, keep the solution’s supported build configuration. Do not append --noEmit to tsc -b without checking the pinned compiler’s support and reference constraints. Reference consumers may require dependency declarations. When declaration-only builds are appropriate, set emitDeclarationOnly in project configuration and route declarations and .tsbuildinfo to ignored output directories or run in an isolated snapshot. TypeScript 5.6+ build mode writes build information even without an explicit incremental setting. Here, non-mutating checks preserve maintained and staged source; declared scratch build outputs are allowed and must stay untracked.

On Swift toolchains without bundled swift format, use the compatible pinned swift-format executable with lint --strict --recursive for directories. The SwiftLint positional-path example requires version 0.56 or later; check older CLI syntax before copying it. For .NET, pin AnalysisLevel, enable <EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>, and configure selected IDE style diagnostics as warnings/errors for build enforcement. dotnet format defaults to warning severity; include --severity info when those rules belong to the gate.

Use a tested google-java-format launcher, native binary, or build plugin for the pinned Java Development Kit (JDK). JDK 16+ module encapsulation can require the documented --add-exports options when the launcher does not provide them. Checkstyle and Error Prone cover different concerns; select complementary rules without repeating the formatter’s layout policy.

gofmt -l reports filenames; the wrapper must convert nonempty output into failure and also preserve tool errors. go fmt mutates files, so it is not the gate’s check command. For Go, Swift, .NET, and other tools that can resolve dependencies implicitly, prepare dependencies separately and enforce offline execution in hooks. A command that needs missing dependencies defers or fails explicitly according to its layer.

For golangci-lint v2, use the version: "2" configuration schema and keep fmt --diff separate from run. If it owns govet and staticcheck, do not repeat the standalone checks. Prepare Terraform modules with terraform init -backend=false before terraform validate in a secretless validation environment. Dependency preparation may need network access; keep it outside edit hooks. Validate each maintained module explicitly.

Use three enforcement layers

  1. After an edit: a trusted adapter calls the repository’s formatter and quick linter for touched files. Return the path, rule, location, and repair command. Missing repository opt-in produces one actionable setup notice; it never claims that lint passed. Do not guess tools from extensions or execute discovered scripts in untrusted directories.
  2. Before a commit: check formatting and lint against the staged snapshot. Run types once per affected project or module and its dependency closure. Use the existing Git hook manager. A failure rejects the commit and names the repair command. A whole-project check is safer than an unproven scope.
  3. Before delivery: run one non-mutating static command near the start of the aggregate local gate, before expensive tests and automated review. CI calls the same definition with its full required scope. Preserve tests, security checks, architecture checks, and generation validation.

Project typing requires project context. Passing staged TypeScript filenames to tsc can bypass tsconfig.json; use the configured project instead. Mypy, Kotlin, Scala, Clippy, Roslyn, and compilation checks also need their import, package, or build context. A file lint result cannot claim those checks.

Harness adapters must verify the installed version’s event and feedback contract. Prove loading, firing, extraction of every touched path, diagnostic visibility, timeout behaviour, and recursion prevention in isolated fixtures. A successful shell exit or stdout line does not establish model-visible feedback. If a harness cannot inject diagnostics after edits, use a documented supported feedback channel or report that limitation. Do not claim coverage from a configuration entry alone.

Shell writes and external tools can bypass file-tool events. Git hooks can also be absent or bypassed. Check the resulting snapshot in the full gate, and require the CI result before merge.

Deliver actionable findings while the author is editing or reviewing the change. The Facebook study reports better uptake from diff-time integration than from batch reporting. Use batch scans for inventories and deeper checks, then route findings to an owner; do not rely on an unattended dashboard. For legacy adoption, a reviewed changed-code policy may block new findings on a pull-request diff while reporting the remaining debt separately. For example, golangci-lint run --new-from-rev=<base> needs an explicit, available base commit. Avoid its --new shortcut in CI, where working-tree state can affect selection. Such filtering is narrower evidence than a full ratchet and must not replace it without an explicit adoption decision.

Budget the fast path

Start with these policy targets, then measure representative cold and warm runs before setting project timeouts:

LayerInitial targetBounds and fallback
EditWarm p95 below two secondsOne active checker per workspace; bounded pending work and diagnostics; no network, installation, or full build
Common scoped commitWarm completion below 30 secondsProject-aware checks with prepared dependencies; expand uncertain scope
Full gateProject-owned time and peak-memory budgetsComplete required static scope with bounded workers and explicit resource limits

Record cold startup separately. Coalesce repeated events without losing the latest file state. Cap pending paths and fall back to a declared broader check when the queue limit is reached. Report omitted diagnostic counts and a command to obtain the complete result. Keep full diagnostics in a bounded artifact.

If a semantic check cannot meet the edit budget, defer it to the staged or full gate and say so. If compilation exceeds the commit budget, retain it as a required full-gate check and label the commit result’s narrower scope. A timeout is incomplete evidence. Kill and reap the task-owned checker; do not leave accumulating background processes. Measure latency and peak memory as described in Performance and memory.

Format safely

  • Use one formatter owner for each file type. Permit only reviewed safe formatting fixes after an edit; semantic auto-fixes need separate review. Tool safety labels guide selection, but inspect diffs and verify behaviour. Ruff’s --fix excludes unsafe fixes by default; --unsafe-fixes expands that scope. RuboCop distinguishes -a from the broader -A. Keep unsafe rewrites and cargo clippy --fix behind an explicit repair command and review. ESLint suggestions also need deliberate selection.
  • Keep commit and CI checks non-mutating. Never auto-stage files or re-stage whole files after formatting. Preserve partially staged and unstaged work.
  • Validate the index snapshot through an isolated snapshot or a tested hook manager that preserves unstaged work. Test restoration on failure as well as success; checking the working tree alone is insufficient.
  • Validate paths against the authorized repository. Handle multi-file patches, spaces, renames, deletions, nested packages, and generated/vendor exclusions.
  • Prevent formatter-triggered recursion. Before applying delayed formatting, compare the current file digest with the event’s digest; discard stale work. Serialize writes so an older result cannot overwrite a newer edit.
  • Keep applied migrations immutable. Validate them without rewriting their bytes; apply formatting policy to new migrations before application.
  • Isolate bulk formatter adoption in formatting-only commits. Record their full commit identifiers in .git-blame-ignore-revs and document git config blame.ignoreRevsFile .git-blame-ignore-revs for contributors. This lets Git omit those revisions when tracing line history; it does not guarantee perfect authorship reconstruction across arbitrary rewrites.

Ratchet debt and exceptions

Store reviewed allowances by stable diagnostic fingerprint with occurrence count, rule, owner, reason, and review date. Prefer native baselines when they can meet the policy; add a small comparator only when needed. Avoid line-number identity alone, which changes under unrelated edits.

The gate rejects new fingerprints and increased counts. It also rejects stale allowances: remove an entry or reduce its count when a defect is fixed. A comparator that only rejects increases leaves an allowance available for a later reintroduction. Prove the comparator with add, duplicate, fix, and reintroduce cases.

Use a narrow rule suppression at the relevant location when possible. Record its reason and owner. Broad file or directory exclusions need a scope rationale and a separate validation owner. Never regenerate a baseline just to turn a failure green. Tool upgrades and intentional rule changes require a reviewed diagnostic diff; baseline churn must not conceal new debt.

Verify the installed tool’s staleness behaviour. Detekt’s baseline does not by itself reject resolved entries; add a comparison against a freshly generated candidate in scratch space. Fail on drift without replacing the reviewed baseline. ESLint bulk suppressions fail on unpruned allowances by default; run --prune-suppressions as an explicit repair, never bypass with --pass-on-unpruned-suppressions in the gate. RuboCop’s --report-unused-todo-entries rejects unnecessary TODO exclusions without absorbing new offenses. Exercise these mechanisms with the pinned version.

Remove stale inline suppressions too. Enable Ruff RUF100, mypy --warn-unused-ignores, or Pyright reportUnnecessaryTypeIgnoreComment. Configure ESLint unused-disable reporting as an error, for example with --report-unused-disable-directives-severity error. On supported Rust versions, prefer #[expect(lint_name, reason = "...")] for expected exceptions and deny unfulfilled_lint_expectations. Verify the expectation fails when the underlying violation disappears. A permanent allow does not provide the same staleness assertion.

Preserve failure contracts

Required checks fail on violations, missing tools, invalid configuration, unsupported runtimes, crashes, and incomplete execution. Preserve nonzero statuses through pipelines and aggregate runners. Report “no applicable files” separately from “configured scope unexpectedly empty.” The latter is a setup failure when source is expected.

Keep empty-pattern escape flags out of the full gate. ESLint’s --no-error-on-unmatched-pattern and --pass-on-no-patterns can hide an incorrect maintained-source root. Scoped wrappers may handle an intentional empty selection explicitly; record that outcome without claiming a pass over files that were never checked.

Do not wrap mandatory checks in || true, || echo, optional-script flags, or unconditional success exits. A reminder to run lint does not reject a defect. Set an explicit warning policy; if selected warnings block delivery, configure the tool or wrapper to fail on them. A new warning policy needs a debt inventory before compiler-wide warnings as errors are enabled.

Verify warning exits against deliberate diagnostics. The command table uses --fatal-infos for Dart, --max-warnings 0 for blocking ESLint warnings, --warnings-as-errors for selected clang-tidy checks, strict Swift linting, and Astro’s minimum failing severity. RuboCop’s --raise-cop-error makes internal cop exceptions fail explicitly. .NET style enforcement needs the build property and diagnostic severities as well as the build’s warning policy.

Prove failure propagation with a deliberate formatting defect, a selected lint violation, a type/compile defect, a missing executable, and a checker crash. Run these in isolated synthetic fixtures. Each must produce the expected nonzero gate status; remove deliberate defects before publication.

Prove CI parity

Use the same pinned tools, configuration, exclusions, and static-check owner locally and in CI. CI checks the complete maintained scope required by policy. Expand local selection when configuration, lockfiles, compiler flags, schemas, or shared dependencies change. Unknown scope falls back to full static checks.

Record source identity or digest, configuration and lockfile digests, tool versions, scope, duration, and exit status. Invalidate cached evidence when any relevant input changes. A scoped fast result must not be reused as proof of full analysis. Confirm required forge checks actually block merge; a green optional workflow alone does not establish that policy.

When multiple analyzers feed annotations or debt comparisons, prefer Static Analysis Results Interchange Format (SARIF) 2.1.0 where supported. For example, Ruff can emit --output-format=sarif. Keep a readable bounded summary for immediate feedback. Validate report shape and completeness; preserve rule IDs, locations, and supplied fingerprints. SARIF fields alone do not guarantee stable identity across tool upgrades or refactors. Verify any converter before using its output for a ratchet. Bound artifact size and retention, remove private payloads and paths, and keep upload permissions separate from read-only analysis. SARIF reporting does not replace the check’s blocking exit status.

Keep pull-request validation read-only and secretless. Linting can load plugins and build configuration, so repository trust still matters. Follow Secure and reliable systems for dependency and execution boundaries, and CI for agentic engineering for the canonical gate, independent merge evidence, caching, and CI permissions.

Adoption procedure

  1. Inventory maintained languages, existing tool configuration, actual callers, hook activation, exclusions, and CI failure propagation. Stop short of choosing a tool for a source tree that has not been inspected.
  2. Choose one owner per responsibility. Preserve compatible existing choices, pin versions, and document runtime and generated-code boundaries.
  3. Run the full checks without changing source. Inventory diagnostics and measure cold/warm duration and peak memory. Select blocking rules.
  4. Fix defects or approve a bounded debt baseline with owner and review date. Prove that the baseline shrinks and rejects reintroduced defects. Isolate bulk formatting and record blame exclusions. If adopting a temporary diff-only policy, document its uninspected debt and exit criteria.
  5. Add the repository-owned static command to the existing gate and CI. Exercise deliberate failure fixtures and verify required forge checks.
  6. Enable staged checks. Prove correct scope and preservation of partial staging and unstaged work on success, failure, and interruption.
  7. Enable per-edit adapters after native-event fixtures prove activation and visible feedback. Measure the budget; defer expensive semantic work clearly.
  8. Compare deterministic failures caught before review and later repair commits by cause over a representative batch. Record scope and workload differences. The goal is fewer avoidable repair rounds; no reduction is promised here.

Completion means the failure fixtures reject defects, clean fixtures pass, local and CI definitions agree, and hooks meet their stated scope and budgets. If a tool or feedback channel is unavailable, record the gap and retain the required full-gate check before claiming adoption complete.

Checklist

  • Every maintained language has an owner, pinned tools, configuration, and scope.
  • Formatting, linting, typing, architecture checks, and tests have distinct roles.
  • Fast commands and full commands share rules and report their actual scope.
  • Project type/compile checks retain dependency and build context.
  • Edit checks bound latency, memory, output, concurrency, and pending work.
  • Timeouts and deferred checks remain incomplete evidence.
  • Hook installation and model-visible feedback are demonstrated.
  • Staged checks validate the index and preserve unstaged work.
  • Commit and CI checks do not mutate or stage files.
  • Generated/vendor exclusions and immutable migration policy are explicit.
  • Baselines reject new debt and require removal of resolved allowances.
  • Unused inline suppressions fail when their diagnostic disappears.
  • Diagnostics explain the issue and repair; noisy rules have an owner and review target.
  • Tool-specific severity switches and directory recursion cover the declared scope.
  • Bulk formatting commits have blame exclusions and no behavioural edits.
  • Mandatory check failures, setup errors, and crashes propagate nonzero.
  • Full local and required CI checks use the same static definition.
  • Failure fixtures and clean fixtures prove the enforcement path.

Rules of thumb

Keep one rule owner and several callers. A result proves only the source snapshot and scope it checked. Fixes should reduce the accepted debt.

Anti-patterns

PatternRepair
Tool installed or configured but never calledTrace the caller and prove a deliberate defect fails
Reminder presented as enforcementReturn visible diagnostics and reject failing snapshots
Lint script with missing configurationFail with an actionable setup error
Compiler called on filenames without project contextCheck the configured project and dependency closure
Timeout or missing tool treated as successReport incomplete evidence or reject at the required layer
Baseline refreshed to admit new failuresReview the diagnostic diff and remove resolved allowances
Whole-tree formatting and re-staging at commitUse check-only staged validation and an explicit repair command
Fast local lint presented as full CI evidenceRecord scope and run the full required definition

Claim review

  • Recommendations and timing targets are labelled as policy.
  • Tool mechanics link to primary documentation; commands need pinned-version verification.
  • No project results, measured speedups, or complete hook integrations are claimed.

Privacy review

  • No employer material.
  • No customer material.
  • No private repository identifiers, counts, paths, or source snapshots.
  • No trace material.
  • No transcript material.
  • All examples are synthetic.