fix: reduce false positives in rules 003, 004, and 400#188
Merged
Conversation
Rule 003 (Ubuntu-names-versions): extend the LTS lookahead to also accept point releases. The pattern 'Ubuntu \d?[02468]\.04(?! LTS)' incorrectly flags 'Ubuntu 24.04.4 LTS' because after '24.04' comes '.4', not ' LTS'. Change to '(?!\.\d| LTS)' to allow both. Rule 004 (Canonical-product-names): add explicit word boundary to the Ubuntu Pro pattern. 'nonword: true' means Vale does not add implicit word boundaries, so '(?<=Ubuntu )Pro' matches any word starting with 'pro' after 'Ubuntu' — e.g. 'Ubuntu project', 'Ubuntu provides'. Change to '(?<=Ubuntu )Pro\b' to match only the whole word 'Pro'. Rule 400 (Enforce-inclusive-terms): exclude 'master' in URL path segments. The token 'masters?' fires on 'master' inside URL paths (e.g. '.../blob/master/README.md') which are not actual uses of the term. Add a negative lookbehind '(?<!/)' to exclude URL contexts. Add test cases to manifest.yml for the 003 point-release fix and the 004 Ubuntu Pro word-boundary fix. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
SecondSkoll
approved these changes
Apr 7, 2026
Contributor
SecondSkoll
left a comment
There was a problem hiding this comment.
LGTM. Thanks for the feedback and PR!
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.
Fixes three sources of false positives discovered while running these rules against ubuntu-project-docs.
Rule 003 — point releases falsely flagged
Ubuntu \d?[02468]\.04(?! LTS)fires onUbuntu 24.04.4 LTSbecause after24.04the lookahead sees.4, notLTS.Rule 004 — "Ubuntu Pro" matches "Ubuntu project", "Ubuntu provides", etc.
nonword: truedisables implicit word boundaries, so(?<=Ubuntu )Promatches any word that begins with "pro" after "Ubuntu ". This triggers on valid prose like "Ubuntu project", "Ubuntu provides", "Ubuntu proposed-migration".Fix: Add an explicit word boundary:
(?<=Ubuntu )Pro\b.Rule 400 — "master" in URL paths
The token
masters?fires on "master" inside URL path components (e.g..../blob/master/README.md) which are not uses of the term.All existing tests pass and new test cases are added for the 003 and 004 fixes.
Done with Copilot + Claude Sonnet.