Run make test to lint and test. See Makefile for available targets and variables.
Go CLI tool that validates SOPS encryption in git pre-commit hooks. Accepts changed files via args or stdin, then decrypts each to verify encryption.
- Entry point:
cmd/sops-precommit/main.go→cli.NewRootCommand().Execute() - Core logic:
internal/cli/cli.go— if no.sops.yamlconfig exists, exits early with success. Otherwise filters files to those matchingcreation_rulesand validates decryption. - Testability:
decrypterandsopsRuleMatcherinterfaces abstract the SOPS library. Tests usedecryptmock.