Content Lint check
The Content Lint check is the always-on half of kapi check. It reads each
translatable block's source text on its own, with no target and no locale
comparison, and reports what is wrong with the shape of the content:
hygiene.empty: the block holds nothing but whitespace. Major, and the only finding reported for that block, because the rest have nothing to judge.hygiene.leading-whitespaceandhygiene.trailing-whitespace: whitespace on an edge that an author left there.hygiene.double-spaces: two or more spaces between two pieces of content on one line.hygiene.doubled-word: a word immediately repeated, compared without regard to case.hygiene.control-char: a stray control character. Tab, carriage return and line feed are ordinary whitespace and are not reported.
Everything but the emptiness finding is minor, so a document of nits still passes an ordinary gate and shows in the score. The exception is a double space in a comment, which is major.
Every one of these is a judgement about shape, and shape is judged over the block's runs rather than its plain text. A placeholder is content: it holds a position, so the space beside it separates it from a word rather than trailing off the content's edge. An inline code span stands whole, so what an author wrote inside backticks is quoted rather than graded, so two spaces in a code span are the example rather than a defect. And a single terminating line break is the content's line ending, which formats such as a YAML block scalar require, so it is not whitespace anyone left behind.
Rules
A finding carries one of these rule ids. The family is hygiene, which differs from the check id the code registers.
| Rule | Severity | Reports | Fix |
|---|---|---|---|
hygiene.empty | major | The block holds nothing but whitespace. It is the only finding reported for that block, because the rest have nothing to judge. | Give the block content, or remove the block from the source. |
hygiene.leading-whitespace | minor | Whitespace at the start of the block that an author left there. | Remove the leading whitespace from the source text. |
hygiene.trailing-whitespace | minor | Whitespace at the end of the block, beyond a single terminating line break, that an author left there. | Remove the trailing whitespace from the source text. |
hygiene.double-spaces | minor | Two or more spaces between two pieces of content on one line. In a comment the finding is major and covers a run of exactly two spaces. | Replace the run of spaces with one space. |
hygiene.doubled-word | minor | A word immediately repeated, compared without regard to case. The finding quotes the word. | Remove the repeated word. |
hygiene.control-char | minor | A stray control character, named by its code point. Tab, carriage return and line feed are ordinary whitespace and are never reported. | Remove the control character, or replace it with the character the text needs. |
This check takes no flag of its own.
Processing notes
Always on. It needs no configuration and has no flag to enable or disable it.
Findings carry the stable rule id
hygiene.<category>and the block's location, so a fix loop can address the exact block and track a rule across iterations.The double-space rule discounts a run of spaces that indents a continuation line, because that is the source's line structure rather than spacing inside a sentence.
In a comment, the double-space rule reports only a run of exactly two spaces between two characters, and not one that ends where a word starts on the line above or below, or one inside backticks or double quotes, because a comment lays text out in columns and quotes literal text. A double space it does report is major.
The doubled-word rule reports a repeated word, so a repeated glyph or bullet, the notation an author meant to show, is not one.
Limitations
Reads source text only; a mismatch between a source and its translation is the bilingual
qacheck's question.Judges shape rather than language, and performs no spelling, grammar or style analysis.
Runs over translatable blocks; content a reader surfaces as structure or code is never graded.
← Back to the Check Reference