Class: Moult::CLI::GateCommand
- Inherits:
-
Object
- Object
- Moult::CLI::GateCommand
- Defined in:
- lib/moult/cli/gate_command.rb
Overview
moult gate [PATH] — the diff-aware PR risk gate. Thin layer: parse options,
build the index + Rails awareness, resolve the policy (defaults, overridable
via .moult.yml), drive Gate.build_report, hand the GateReport to a
formatter. Holds NO policy logic.
Exit code (the one command in Moult that renders a verdict, so it is the one exception to the repo-wide "1 = error" convention):
0 = gate passed
1 = gate failed (policy violated)
2 = tool error (bad option, missing path, unresolvable diff, …)
Constant Summary collapse
- PASS =
0- FAIL =
1- ERROR =
2
Instance Method Summary collapse
-
#run(argv) ⇒ Integer
Process exit status.
Instance Method Details
#run(argv) ⇒ Integer
Returns process exit status.
24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/moult/cli/gate_command.rb', line 24 def run(argv) = parse(argv) return puts_help if [:help] execute() rescue OptionParser::ParseError, Moult::Error => e warn "moult: #{e.}" ERROR rescue => e warn "moult: #{e.}" ERROR end |