redline explain
Turn the rule id in a finding into the rule, where it is defined, and who receives it.
Every finding cites a rule id in brackets, such as [core/hardcoded-secrets]. explain prints that rule's text, whether a checker or review judgement decides it, the standards file and line that defines it, the files it applies to, and every profile that receives it. Run it when a finding on your pull request is not clear.
Where it runs: Anywhere, including a directory that was never onboarded. The rules are built into the CLI.
Synopsis
redline explain <rule-id> [--json]
redline explain --listFlags
| Flag | Default | What it does |
|---|---|---|
--list | off | Every rule id in the standards, with its severity. |
--json | off | The rule, its scope and the profiles it reaches, as JSON on stdout. |
--help prints the same list from the CLI you have installed.
Examples
Explain a finding
$ pnpm redline explain core/hardcoded-secrets BLOCKER core/hardcoded-secrets No hardcoded secrets, API keys, tokens, or credentials — including in test files, fixtures, config samples, and comments. decided by review judgement defined in standards/core.md:64 applies to every file — the core standard is not scoped by stack reaches javascript-typescript, web-react, web-nextjs, …
$ npx redlinegate explain core/hardcoded-secrets BLOCKER core/hardcoded-secrets No hardcoded secrets, API keys, tokens, or credentials — including in test files, fixtures, config samples, and comments. decided by review judgement defined in standards/core.md:64 applies to every file — the core standard is not scoped by stack reaches javascript-typescript, web-react, web-nextjs, …
$ yarn redline explain core/hardcoded-secrets BLOCKER core/hardcoded-secrets No hardcoded secrets, API keys, tokens, or credentials — including in test files, fixtures, config samples, and comments. decided by review judgement defined in standards/core.md:64 applies to every file — the core standard is not scoped by stack reaches javascript-typescript, web-react, web-nextjs, …
$ bun run redline explain core/hardcoded-secrets BLOCKER core/hardcoded-secrets No hardcoded secrets, API keys, tokens, or credentials — including in test files, fixtures, config samples, and comments. decided by review judgement defined in standards/core.md:64 applies to every file — the core standard is not scoped by stack reaches javascript-typescript, web-react, web-nextjs, …
Find an id you half remember
$ pnpm redline explain --list | grep secret
$ npx redlinegate explain --list | grep secret
$ yarn redline explain --list | grep secret
$ bun run redline explain --list | grep secret
Exit codes
| Code | Meaning |
|---|---|
0 | Success. |
2 | No rule id given, or no rule with that id. The error points at --list. |
Related
- The standards
- The output contract
- All commands and the shared exit codes
- Source:
cli/rules/catalogue.ts