Parameter table that does not match the signature
parameter-table-mismatchon by defaultJapanese / English
A parameter in only one of a signature and the parameter table under it
Example
How to fix
Check the function's real parameters, and correct the table or the signature.
Why it matters
When an API reference's signature and the parameter table under it list different parameters, the reader cannot tell which is right, and passes a parameter that does not exist or never learns of one that does. It happens when a parameter is added or renamed in one place only. When a code block declares exactly one function (with function or def, or with a return type) and a table whose first header is Parameter or Argument follows it before the next heading or code block, the two are compared. A parameter only in the table is pointed out on its row, and one only in the signature on the signature.
What it does not flag
A call (wrap(text, 10);), a code block that declares two or more functions, a destructured parameter ({ a, b }), self and this, a table whose first header is not a parameter word (Option, Field), a table after another heading or code block, and a table whose rows do not start with | are not compared. A declaration with its types before the names (Java's String wrap(String text)) is not read. options.prefix in a table is read as a field of options.
Turning it off or relaxing it
Technical details
- Layer
- L1
- Status
- stable
- Severity
- warning
- 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 | error |
|---|---|
| normal | warning |
| 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
`{name}` is in only one of the signature of `{function}` and its parameter table
This page is built from the rule's definition file:packages/chaff/rules/parameter-table-mismatch.yaml