A heading names a command its section's code does not show
heading-command-missingon by default (info)Japanese / English
A command or option named in a heading that the section's examples never use
Example
How to fix
Check which of the heading and the example has the current name, and correct the other.
Why it matters
When the section "## `--dry-run`" shows an example using "--dryrun", the reader cannot tell which is right. It happens when a command or an option is renamed and only the heading or only the example is updated. chaff points out a heading's code part (`npm install`, `--force`, `init`) that appears in none of the code blocks or code spans of its section (up to the next heading of the same or a higher level). A section with no code at all is not checked.
What it does not flag
Sections with no code, headings naming a file or a function (`config.yaml`, `useEffect`), and headings with no code part are not checked. `--force` inside `--force-with-lease` does not count as shown.
Turning it off or relaxing it
Technical details
- Layer
- L1
- Status
- stable
- Severity
- info
- Languages
- Japanese and English
- Suited to
- technical, docs, blog, legal, academic, literature, speech
- Reads from the document
- markdown
Levels
Set a level for this rule under rules in chaff.yaml. With nothing set, it runs at the level its genre gives it (see By genre below).
| strict | warning |
|---|---|
| normal | info |
| relaxed | info |
This rule has no limit to count to. A level sets how a finding is marked: relaxed keeps the finding and marks it a step lower.
By genre
- Runs by default in
- technical/spec, technical/readme, blog/tech, blog/essay, blog/owned-media, docs/manual, docs/faq, docs/glossary
- Turned off by the genre in
- legal/contract, legal/statute, legal/judgment, legal/patent, academic/paper, literature/fiction, literature/essay, literature/poetry, literature/play, speech/address, speech/transcript
- Not suited to, and not run in
- business/proposal, business/report, business/email, business/press-release, business/meeting-notes
Message
"{command}" in this heading does not appear in the section's code
Rewrite depth (chaff fix-plan --depth): light — words and sentences; the structure and the voice stay
This page is built from the rule's definition file:packages/chaff/rules/heading-command-missing.yaml