saphan pr-preflight
Runs seven checks on the current branch before you open a pull request (branch name, working-tree status, commit subjects, how far it is behind the base, submodules, a clean build and a passing scoped
Runs seven checks on the current branch before you open a pull request (branch name, working-tree status, commit subjects, how far it is behind the base, submodules, a clean build and a passing scoped test run) and prints the complete list of what would stop the pull request. Every check runs even when an earlier one fails (except when the directory is not a git repository, which stops it at once), and nothing is fixed or fetched for you: the base branch is compared as it stands locally. Build and test commands, naming patterns and the base branch come from the flags or a project config file. Exits 0 when every check passes, 2 when anything is on the stop list, and 1 on an error.
| flag | type | default | what it does |
|---|---|---|---|
--base | string | The branch the pull request will target. Required, here or in the config file. | |
--branch-pattern | string | A glob the work branch name must match, such as feature/*. | |
--build-cmd | string | The command that must build cleanly, run in the repository directory; it is split into words and run without a shell, so pipes and && do not work. Required, here or in the config file. | |
--config | string | A YAML project config file whose pr-preflight section supplies these settings; flags given on the command line take precedence. | |
--subject-pattern | string | A regular expression (RE2) every commit subject ahead of the base must match. | |
--test-cmd | string | The scoped test command that must pass, run like --build-cmd without a shell. Required, here or in the config file. | |
--workdir | string | The repository directory to check; defaults to the current directory. |
Global options apply to every command — see Every command.