fix: correct ColemanLiau readability message to match its own threshold - #1172
Closed
theredspoon wants to merge 1 commit into
Closed
fix: correct ColemanLiau readability message to match its own threshold#1172theredspoon wants to merge 1 commit into
theredspoon wants to merge 1 commit into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Readability.ColemanLiau's message and its actualconditiondisagree: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 correctedFleschReadingEase'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:
Related
Closes #1171. Found while researching a
check[...]rollup formula for #1163, not otherwise related.