Skip to main content

Module validate

Module validate 

Source
Expand description

Input validation shared by CLI-facing entry points: git refs, root paths, and control-character rejection.

Functionsยง

validate_git_ref
Validate a user-supplied git ref before it reaches a git subprocess: rejects empty refs, option-like refs starting with -, and characters outside the ref-syntax allowlist.
validate_no_control_chars
Reject strings containing control characters (bytes < 0x20) except newline (0x0A) and tab (0x09). This prevents agents from accidentally passing invisible characters in CLI arguments.
validate_root
Canonicalize a project root and require it to be an existing directory.