Documentation
¶
Overview ¶
Command ccvalidate validates a single Conventional Commits header (the first line of a commit message, or a PR title) using this repository's own parser. It is the authoritative on-CI gate and the canonical source consumed by .github/workflows/label.yml.
Usage:
ccvalidate "feat(parser): add foo" # argv echo "feat: add foo" | ccvalidate # stdin (single line) CC_INPUT_FILE=/path/to/title ccvalidate # file (avoids shell quoting in CI) ccvalidate --describe "feat(API)!: add foo" # emit canonical fields
Exit codes:
0 valid Conventional Commits header 1 invalid (parse error printed to stderr) 2 usage error
In --describe mode, on a valid header ccvalidate writes canonicalised key=value lines to stdout:
type=feat scope=api breaking=true
"type" is always lowercased — even if the parser accepted "FEAT" via its Ragel case-insensitive type token — so downstream consumers get a single canonical form. "scope" is emitted only when present; "breaking" is "true" or "false". This makes ccvalidate the single source of truth for validation and labeling.
The parser is run in strict mode. Best-effort mode is intentionally disabled: a CI gate must be authoritative.