majordomus commit validate
Judge one commit message against the repository's commit policy; exit 10 when a finding is an error
majordomus commit validate
Usage
majordomus commit validate [OPTIONS] [FILE]Arguments
| argument | value | default | description |
|---|---|---|---|
| <FILE> | <FILE> | — | The file holding the message; none reads standard input, which is what the `commit-msg` hook has |
| --paths | <PATHS> | — | Judge it as a commit of these paths, comma-separated: what needs them — whether a fix carries a test — is otherwise not judged rather than guessed |
| --rev | <REV> | — | Judge the message of this commit instead of a file: any revision `git show` accepts |
| --repo | <PATH> | — | Start the search for the repository root here (default: the current directory) (accepted by every subcommand) |
| --discovery | vcs | filesystem | vcs | How declarative files are enumerated (accepted by every subcommand)
|
| --strict | flag | — | Refuse to proceed when any file of the layer carries an error diagnostic (accepted by every subcommand) |
| --share | <DIR> | — | The tool distribution's share directory (kinds.yaml, schemas/); default: $MAJORDOMUS_SHARE, then the repository's own share/, then the one beside the executable (accepted by every subcommand) |
| --format | text | json | text | Output shape (accepted by every subcommand)
|
Examples
-
The verdict on a commit that is already made
`--rev` judges the message of any revision `git show` accepts; without it the message is read from a file or from standard input, which is the shape the `commit-msg` hook has. The exit code is the verdict: 0 when nothing of error severity was found, 10 when something was. Here the repository's first commit is subject `install`, which is not `type(scope): subject`, so the answer is 10 and the finding names the eleven type words.
$ majordomus commit validate --rev HEADWhat it asserts: exits 10.
Tested by apps/majordomus-cli/tests/cli_examples.rs, which runs the command against the built executable and asserts what the page states.
Where this comes from
Declared once in apps/majordomus-cli/src/cli.rs: clap for the structure, typed Rust metadata beside it for the examples. This page, majordomus commit validate --help, docs/generated/cli.md and docs/generated/cli.json are projections of that one declaration.
The whole command line on one page: the registry's command-line page. The task lifecycle (init, start, finish, doctor, ...) belongs to the shell tool, a different program: Commands and its specification.