fix(core): skip PronounVerbAgreement for hyphenated compound words#3008
Open
mvanhorn wants to merge 1 commit intoAutomattic:masterfrom
Open
fix(core): skip PronounVerbAgreement for hyphenated compound words#3008mvanhorn wants to merge 1 commit intoAutomattic:masterfrom
mvanhorn wants to merge 1 commit intoAutomattic:masterfrom
Conversation
When a matched verb is immediately followed by a hyphen, it is part of a compound word prefix (e.g. "co-founded", "re-established") rather than a standalone verb. Skip the lint in this case to avoid false positives like suggesting "cos" for "co" in "he co-founded". Fixes Automattic#3006 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
hippietrail
reviewed
Mar 23, 2026
Collaborator
hippietrail
left a comment
There was a problem hiding this comment.
Unfortunately I think this is the wrong fix because it sweeps a weirder problem under the carpet where it will surely mysteriously emerge from again at random times.
The real fix will probably be something in pronoun code or... it's so weird I'm not sure where else to start looking.
| && next_tok.kind.is_hyphen() | ||
| { | ||
| return None; | ||
| } |
Collaborator
There was a problem hiding this comment.
There's a method for this that seems to have gotten merged recently in expr_linter.rs: followed_by_hyphen() by the way. Probably not very discoverable.
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.
Summary
Fixes a false positive where "co-founded" triggers
PronounVerbAgreementbecause "co" is annotated as a pronoun in the dictionary. The linter sees "he" (pronoun) + "co" (verb-like pronoun) and suggests changing "co" to "cos".Changes
In
match_to_lint_with_context, added an early return that checks theaftercontext: if the token immediately following the matched verb is a hyphen, the verb is actually a compound word prefix (like "co-" in "co-founded" or "re-" in "re-established"), not a standalone verb. The lint is skipped in this case.Added a regression test for "In 2014, he co-founded Social Chain." which previously triggered the false positive.
Files changed:
harper-core/src/linting/pronoun_verb_agreement.rsTesting
All 44 existing tests pass. The 2 pre-existing
#[ignore]tests remain unchanged.Fixes #3006
This contribution was developed with AI assistance (Claude Code).