redline exempt
Decide whether a pull request carries a valid exemption for a failing process check.
Reads the ## Redline exemption section of a pull request description and decides whether it covers a failing process check, such as the ADR or checklist check. A valid exemption has a reason of at least 20 characters, an until date no more than 90 days away, and a scope that covers the check. The gate runs it for you. Run it yourself to test a description before you push it.
Where it runs: Anywhere you have the pull request description in a file. The gate runs it in CI.
Synopsis
redline exempt --body-file <path> [--scope <check>] [--json]Flags
| Flag | Default | What it does |
|---|---|---|
--body-file <path> | required | The pull request description, as a file. A file, not an argument, because the description is untrusted text. |
--scope <check> | any | The failing check the exemption has to cover. An exemption with no scope: line covers every check. |
--json | off | Whether it applies, and why, as JSON on stdout. |
--help prints the same list from the CLI you have installed.
Examples
Test an exemption
$ cat > body.md <<'EOF' ## Redline exemption reason: vendor SDK upgrade lands next sprint, ADR to follow until: 2026-11-30 scope: adr EOF $ pnpm redline exempt --body-file body.md --scope adr $ pnpm redline exempt --body-file body.md --scope checklist exempt until 2026-11-30 (adr): vendor SDK upgrade lands next sprint, ADR to follow warn the exemption covers adr — it does not cover "checklist". Widen its scope deliberately, or fix the check.
$ cat > body.md <<'EOF' ## Redline exemption reason: vendor SDK upgrade lands next sprint, ADR to follow until: 2026-11-30 scope: adr EOF $ npx redlinegate exempt --body-file body.md --scope adr $ npx redlinegate exempt --body-file body.md --scope checklist exempt until 2026-11-30 (adr): vendor SDK upgrade lands next sprint, ADR to follow warn the exemption covers adr — it does not cover "checklist". Widen its scope deliberately, or fix the check.
$ cat > body.md <<'EOF' ## Redline exemption reason: vendor SDK upgrade lands next sprint, ADR to follow until: 2026-11-30 scope: adr EOF $ yarn redline exempt --body-file body.md --scope adr $ yarn redline exempt --body-file body.md --scope checklist exempt until 2026-11-30 (adr): vendor SDK upgrade lands next sprint, ADR to follow warn the exemption covers adr — it does not cover "checklist". Widen its scope deliberately, or fix the check.
$ cat > body.md <<'EOF' ## Redline exemption reason: vendor SDK upgrade lands next sprint, ADR to follow until: 2026-11-30 scope: adr EOF $ bun run redline exempt --body-file body.md --scope adr $ bun run redline exempt --body-file body.md --scope checklist exempt until 2026-11-30 (adr): vendor SDK upgrade lands next sprint, ADR to follow warn the exemption covers adr — it does not cover "checklist". Widen its scope deliberately, or fix the check.
Exit codes
| Code | Meaning |
|---|---|
0 | A valid exemption applies. |
1 | No valid exemption: missing, too short a reason, a bad or expired date, more than 90 days out, or the wrong scope. |
2 | No --body-file. |
Related
- Exemptions
- The merge gate
- All commands and the shared exit codes
- Source:
cli/commands/exempt.ts