Saphan StudioDocs
Reference/Commands

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.

saphan pr-preflight --base develop --build-cmd 'make build' --test-cmd 'make test-changed'
saphan pr-preflight
flagtypedefaultwhat it does
--basestringThe branch the pull request will target. Required, here or in the config file.
--branch-patternstringA glob the work branch name must match, such as feature/*.
--build-cmdstringThe 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.
--configstringA YAML project config file whose pr-preflight section supplies these settings; flags given on the command line take precedence.
--subject-patternstringA regular expression (RE2) every commit subject ahead of the base must match.
--test-cmdstringThe scoped test command that must pass, run like --build-cmd without a shell. Required, here or in the config file.
--workdirstringThe repository directory to check; defaults to the current directory.

Global options apply to every command — see Every command.