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 statusEvery 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.
| Check | What it does |
|---|---|
| Version control | Uncommitted files as a worklog, with a per-file line delta and relative age, ordered most-recently-touched |
| Build | go build ./..., with compiler diagnostics parsed and located. Any error fails |
| Lint | golangci-lint when a .golangci.* governs the repo, else a go vet plus gofmt -l fallback |
| Dependencies | go mod tidy delta, replace directives, and go mod verify |
| Runtime | Compares the declared Go version against what the code needs and what deps force. Informational |
| Docs | Exported-symbol doc-comment coverage. Warns below a configurable threshold |
| Tests | go test ./... -json per profile, with per-package, file, and function coverage |
| Benchmarks | go test -bench, skipped instantly when the repo has no func Benchmark |
| Secrets | betterleaks over the working tree and, optionally, git history |
| Vulnerabilities | govulncheck, 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 coverageTwo umbrella flags flip on a whole family at once.
care --quality # build, lint, dependencies, runtime, and docs
care --security # secrets and vulnerabilitiesThe 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 --fixNote
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 logThe 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 --amendWith no report file yet, --amend falls through to a full run that seeds it.