All rules

Space before punctuation

space-before-punctuationon by defaultEnglish

A space before a period, comma or other mark, as in "word ."

Example

Flagged
The form is ready , and the office has a copy .
What chaff prints
1:18 A space before "," 1:46 A space before "."
Fixed
The form is ready, and the office has a copy.
What chaff prints
no finding

How to fix

Delete the space and attach the mark to the word before it.

Why it matters

English attaches punctuation to the word before it. A space before it ("word .", "(word) ,") can leave the mark alone at the start of the next line, and reads as a space left over from an edit. Periods, commas, semicolons, question marks and exclamation marks are checked. A colon ("Note : "), dots spaced out as an ellipsis or a leader in a table of contents (". . ."), a dot that starts the next word (".NET", ".5"), a mark after a number ("[ 1 , N ]" in a formula), code and URLs are not counted, nor are two or more spaces before the mark (a line laid out like a table).

What it does not flag

Colons, dots spaced out as an ellipsis or a leader (". . ."), a dot that starts a word (".NET", ".5"), a mark after a number or after two or more spaces, code and URLs are not reported.

Turning it off or relaxing it

Silence this one spot (in the document)
<!-- stet: space-before-punctuation — reason -->
Relax it for the team (the reason is kept as a comment in chaff.yaml)
npx chaffjs relax space-before-punctuation --why "reason"
Turn it off for the team (chaff.yaml)
rules: space-before-punctuation: off
Technical details
Layer
L1
Status
stable
Severity
warning
Languages
en
Suited to
business, technical, blog, legal, docs, academic, literature, speech

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).

stricterror
normalwarning
relaxedinfo

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, business/proposal, business/report, business/email, business/press-release, business/meeting-notes, legal/contract, legal/statute, legal/judgment, legal/patent, docs/manual, docs/faq, docs/glossary, academic/paper, literature/fiction, literature/essay, literature/poetry, literature/play, speech/address, speech/transcript

Genres

Message

A space before "{mark}"

This page is built from the rule's definition file:packages/chaff/rules/space-before-punctuation.yaml