Skip to content

fix: correct ColemanLiau readability message to match its own threshold - #1172

Closed
theredspoon wants to merge 1 commit into
vale-cli:v3from
theredspoon:fix/colemanliau-message-threshold
Closed

fix: correct ColemanLiau readability message to match its own threshold#1172
theredspoon wants to merge 1 commit into
vale-cli:v3from
theredspoon:fix/colemanliau-message-threshold

Conversation

@theredspoon

Copy link
Copy Markdown

Problem

Readability.ColemanLiau's message and its actual condition disagree:

message: "Try to keep the Coleman–Liau Index grade (%s) below 19."
condition: "> 9"

The rule reports once the computed grade passes 9, but tells the user to keep it below 19.

Why the message, not the condition

Every other formula in this style has its message threshold exactly match its condition: FleschKincaid (8/> 8), FleschReadingEase (70/< 70), GunningFog (10/> 10), SMOG (10/> 10), LIX (35/> 35), AutomatedReadability (8/> 8). ColemanLiau is the only one where they diverge.

Coleman-Liau's grade output is on the same US-grade-level scale as FleschKincaid's and AutomatedReadability's, both of which already use 8 as their threshold, so 9 fits the pattern the rest of the style follows. It also matches published guidance directly: general-audience writing is commonly recommended to target a Coleman-Liau grade around 8-10, with sources specifically citing "8 or less" for public-facing content (readable.com, readabilityformulas.com). A threshold of 19 sits past graduate/academic-level prose on this same scale and would rarely fire on real writing.

Traced the file's history via the GitHub API (local shallow clones don't have it). It's been touched exactly twice since a140d309 ("feat: add Readability style", 2021-11-14), which added it fresh with these exact values, and a pure rename in 2022 with no content change. That founding commit also corrected FleschReadingEase's threshold from 50 to 70 in the same diff. That confirms a deliberate tuning pass rather than a rushed first draft, so a transposed digit (9 becoming 19) in the message string is the likelier explanation. Nothing exercises the message text in a way that would surface the mismatch, so no test or reviewer caught it for about four years.

Fix

Correct the message to match the condition, not the other way around, since 9 is the value consistent with the rest of the style and with published guidance:

message: "Try to keep the Coleman–Liau Index grade (%s) below 9."

Related

Closes #1171. Found while researching a check[...] rollup formula for #1163, not otherwise related.

The message said "below 19" while condition fired at "> 9" -- the
only formula in this style where the two disagree; every sibling
formula has them match exactly.

Traced via the GitHub API: the file has been touched twice since
2021-11-14, its founding commit (which also corrected
FleschReadingEase's threshold from 50 to 70 in the same diff) and a
pure rename with no content change. A deliberate tuning pass, not a
rushed first draft, so a transposed digit in the message is more
likely than a stale placeholder.

9 is the value consistent with the rest of the style (matches
FleschKincaid's and AutomatedReadability's own grade-8 thresholds on
the same scale) and with published guidance recommending a
Coleman-Liau grade around 8-10 for general-audience writing. Fixed
the message to match the condition rather than the other way around.

Refs vale-cli#1171
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Readability.ColemanLiau's message says 'below 19' but its condition fires at 9

1 participant