Setup
Install once, set up the repository, verify it, then run the full check.
uv tool install --python 3.14 code-standardscode-standards setupcode-standards doctorcode-standards checkRun once
uvx --no-config --isolated --python 3.14 --from code-standards code-standards setupsetupInstall the shared configuration and repository hooks.doctorCheck the installation and repair configuration drift.checkRun the same standards locally and in CI.fixApply safe automated fixes, then report what remains.
One Standards version in TOML
Generated hooks and CI invoke
uvx --no-config --isolated --python 3.14 --from sarj-standards-bootstrap code-standards.
uvx installs and caches the lightweight bootstrap, which reads the exact bundle
version from .sarj-standards.toml. No mise integration or repository-local launcher
script is needed.
Run
uvx --no-config --isolated --python 3.14 --from sarj-standards-bootstrap code-standards doctor --repair
to migrate older managed launchers and reconcile configuration and hooks. The bootstrap is
intentionally unpinned; the linting release remains exactly pinned in the manifest.
A cold cache resolves and installs the bootstrap; subsequent invocations reuse it without requesting a refresh on every hook. Offline execution requires the bootstrap, the selected bundle, their Python runtime, and dependencies to be cached already.
A directly installed repo-standards dependency belongs in
pyproject.toml and its resolved lockfile, not in repeated shell commands.
Lockfile entries and generated provenance are reproducibility records, not additional
versions to maintain by hand.
Mobile projects
Swift and Kotlin checks are fail-closed and opt in only when setup finds a real Apple mobile project (iOS, tvOS, watchOS, or visionOS) or an applied Android/Kotlin Multiplatform mobile plugin. Server-side Swift, JVM-only Kotlin, unused version-catalog entries, dependency trees, and generated output do not activate the mobile baseline.
The generated pre-commit or Lefthook command checks staged .swift, .kt, and
.kts files inside the recorded mobile destination. Swift runs SwiftFormat, SwiftLint, and the
MobSF security rules; Kotlin runs ktlint, Detekt, and the same security layer. Multiple independent mobile
roots fail setup until one reviewed owner is selected with --swift-dest or
--kotlin-dest.
Swift checks require macOS and Xcode command-line tools. Kotlin checks require Java. The first run downloads version-, commit-, and checksum-pinned tools plus 51 checksum-pinned MobSF rules and may take several minutes; generated mobile CI allows 60 minutes. Later runs reuse the managed cache. Semgrep parse warnings and incomplete file coverage fail the security check instead of being reported as clean.
The fast Detekt pre-commit tier is source-only. Projects that use Compose, public-ABI, or type-resolution
Detekt plugins should keep their Gradle detektMain and Android Lint tasks as an additional CI
gate; Standards does not claim those project-aware checks ran from a standalone file invocation.
Generated analysis inputs
When lint configuration imports ignored build or code-generation output, declare the exact preparation commands
in .sarj-standards.toml. show ci emits them after dependency installation and before
analysis; Standards never guesses a repository build script.
[ci]bootstrap = ["yarn generate", "uv run --project python generate-api"]Global options
-h, --help- Show this message and exit.
--root DEST- repository root shared by the selected command (default: current directory)
--version
code-standards commit-message
enforce [(i/N) ][TICKET] type(scope)!: description with safe mechanical fixes
code-standards commit-message [-h] COMMIT_MSG_FILEcode-standards doctor
diagnose adoption health and optionally repair safe drift
code-standards doctor [-h] [--format OUTPUT_FORMAT] [--repair] [--no-install]code-standards setup
adopt or converge the repository in one idempotent operation
code-standards setup [-h] [--hooks HOOKS] [--python-dest PYTHON_DEST] [--typescript-dest TYPESCRIPT_DEST] [--swift-dest SWIFT_DEST] [--kotlin-dest KOTLIN_DEST] [--dry-run] [--force] [--no-install] [--commit-policy-only] [--config ONLY ...]code-standards check
run the complete quality gate or check selected paths or custom rules
code-standards check [-h] [--trust-repository-code] [--staged] [--rule SELECTED_RULES ...] [--format OUTPUT_FORMAT] [--output OUTPUT] [--max-annotations-per-level MAX_ANNOTATIONS_PER_LEVEL] [FILES ...]code-standards validate-slack-automations
validate a versioned Slack automation catalog
code-standards validate-slack-automations [-h] PATHcode-standards observe
report warning-stage findings with exit 0; invalid input or execution still exits 2
code-standards observe [-h] --rule SELECTED_RULES ... [--format OUTPUT_FORMAT] [--output OUTPUT] [--trust-repository-code] [--max-annotations-per-level MAX_ANNOTATIONS_PER_LEVEL] [FILES ...]code-standards fix
apply safe formatting and lint fixes
code-standards fix [-h] [--staged] [FILES ...]code-standards update
upgrade to the latest published coherent Standards bundle
code-standards update [-h] [--check] [--offline] [--to VERSION] [--no-install]code-standards baseline
grandfather today's findings so only new ones fail
code-standards baseline [-h] {init,update}code-standards baseline init
record the first diagnostic baseline
code-standards baseline init [-h] [--output OUTPUT] [--trust-repository-code] [FILES ...]code-standards baseline update
re-record the diagnostic baseline after reviewed cleanup
code-standards baseline update [-h] [--output OUTPUT] [--trust-repository-code] [--rule BASELINE_RULES ...] [FILES ...]code-standards ratchet
keep the Python suppression budget from growing
code-standards ratchet [-h] {init,check,status,update}code-standards ratchet init
create the first suppression budget
code-standards ratchet init [-h] [--baseline BASELINE] [--package PACKAGE ...] [--exclude-subtree EXCLUDE_SUBTREE ...]code-standards ratchet check
fail when suppression debt grows
code-standards ratchet check [-h] [--baseline BASELINE] [--package PACKAGE ...] [--exclude-subtree EXCLUDE_SUBTREE ...]code-standards ratchet status
show current suppression debt and available reductions
code-standards ratchet status [-h] [--baseline BASELINE] [--package PACKAGE ...] [--exclude-subtree EXCLUDE_SUBTREE ...]code-standards ratchet update
lock in reviewed suppression-budget changes
code-standards ratchet update [-h] [--baseline BASELINE] [--package PACKAGE ...] [--exclude-subtree EXCLUDE_SUBTREE ...] [--allow-increase]code-standards exclude
inspect or change explicit path and rule exclusions
code-standards exclude [-h] {list,add,remove}code-standards exclude list
list the complete denylist
code-standards exclude list [-h]code-standards exclude add
add one exact denylist entry
code-standards exclude add [-h] {path,rule} VALUEcode-standards exclude remove
remove one exact denylist entry
code-standards exclude remove [-h] {path,rule} VALUEcode-standards show
print read-only package and adoption information
code-standards show [-h] {state,configs,config,peers,rules,ci}code-standards show state
print detected adoption state as JSON
code-standards show state [-h]code-standards show configs
list bundled configurations
code-standards show configs [-h]code-standards show config
print one bundled configuration path
code-standards show config [-h] NAMEcode-standards show peers
show tested ESLint peer dependencies and install command
code-standards show peers [-h]code-standards show rules
print the machine-readable custom-rule inventory
code-standards show rules [-h]code-standards show ci
print a complete versioned GitHub Actions standards workflow
code-standards show ci [-h] [--output OUTPUT]