hack/checksecretparts/README.md
Static analysis check that finds detector packages which construct
detectors.Result values without populating the SecretParts field.
For each directory under pkg/detectors/ (recursing into subpackages):
detectors.Result{...} or
&detectors.Result{...} in non-test .go files.SecretParts anywhere, emit a warning
for each construction site.# Warning mode (default): prints findings, always exits 0 unless scanning fails.
go run ./hack/checksecretparts
# Scan specific directories instead of ./pkg/detectors.
go run ./hack/checksecretparts ./pkg/detectors/aws ./pkg/detectors/github
# Fail mode: exit 1 if any findings are reported. Use this once every detector
# has been migrated to populate SecretParts.
go run ./hack/checksecretparts -fail
Once every detector populates SecretParts, make this check gating:
.github/workflows/lint.yml, drop continue-on-error: true from the
checksecretparts job and change the run step to pass -fail.detectors.Result by selector-expr
name; packages that rename the import (d "...detectors") would not be
caught. No such rename exists in the current codebase.