DocsCareRunning checks

Running checks

Run care as a quality gate, select which checks run, apply fixes, and emit JSON reports.

care status runs the checks against the current repo and renders the result. Bare care is the same command with everything on, so these two are equivalent.

care
care status

Every check rolls up into one grade, and the process exits non-zero when any check fails. That exit code is what makes care a gate. A build script or a CI step can run it and stop on a failing result.

The checks

Each check runs only where it applies and skips itself otherwise. There are no benchmarks in a repo with none, and nothing Go runs in a non-Go repo.

CheckWhat it does
Version controlUncommitted files as a worklog, with a per-file line delta and relative age, ordered most-recently-touched
Buildgo build ./..., with compiler diagnostics parsed and located. Any error fails
Lintgolangci-lint when a .golangci.* governs the repo, else a go vet plus gofmt -l fallback
Dependenciesgo mod tidy delta, replace directives, and go mod verify
RuntimeCompares the declared Go version against what the code needs and what deps force. Informational
DocsExported-symbol doc-comment coverage. Warns below a configurable threshold
Testsgo test ./... -json per profile, with per-package, file, and function coverage
Benchmarksgo test -bench, skipped instantly when the repo has no func Benchmark
Secretsbetterleaks over the working tree and, optionally, git history
Vulnerabilitiesgovulncheck, called-only findings, categorized so toolchain CVEs do not fail the grade

Selecting which checks run

Passing no feature flag runs everything. Pass one or more feature flags to run only those checks. Each check has its own flag.

care --build --lint            # only build and lint
care -b -l                     # the same, short forms
care --tests --coverage        # tests with coverage

Two umbrella flags flip on a whole family at once.

care --quality    # build, lint, dependencies, runtime, and docs
care --security   # secrets and vulnerabilities

The full flag list, including short forms and the environment variables that set each one, is in the commands reference.

Coverage, race, and fixes

--coverage collects test coverage and implies --tests. --race runs tests with -race. --fix applies auto-fixes (a lint fix pass and a go mod tidy) before checking, so the report reflects the repaired tree.

care --tests --coverage --race
care --fix

Note

A default care run already collects coverage. --coverage matters only when you have narrowed the run to a subset of checks and still want tests measured.

JSON reports

--json emits the full report to stdout with the numbers that matter lifted to the top. --output <file> writes that JSON to a file instead. --stdout renders the human report as well, which is useful in CI where you want both the log and the machine artifact.

care --json                          # JSON to stdout
care --output report.care.json       # JSON to a file
care --output report.care.json -s    # file plus the human report in the log

The format is stable and meant to be consumed. Ingest it into a dashboard, a status badge, or any other tooling.

Fast refresh with amend

--amend is a fast one-shot refresh of only the working-tree state, merged into the --output file and re-graded from the preserved heavy-check results. It runs about 36x faster than a full pass, so an external watcher, cron job, or status bar can poll it cheaply. care never loops itself. The caller repeats the call.

care --output report.care.json --amend

With no report file yet, --amend falls through to a full run that seeds it.