fix(lint): avoid DoToDueTo false positives for compound verbs#3803
Open
ychampion wants to merge 1 commit into
Open
fix(lint): avoid DoToDueTo false positives for compound verbs#3803ychampion wants to merge 1 commit into
ychampion wants to merge 1 commit into
Conversation
Keep the existing Weir matcher and filter only modal contexts where the words after 'to' form a dictionary-known verb lemma. Constraint: Preserve the public DoToDueTo rule name and its existing causal corrections. Rejected: Suppress every dictionary-known compound verb | that would hide causal typos such as 'delayed do to beta test results'. Confidence: high Scope-risk: narrow Tested: cargo test -p harper-core --lib; targeted default/no-default tests; cargo fmt; targeted clippy Not-tested: Full monorepo precommit because JavaScript dependencies are not installed.
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.
AI disclosure: This change was implemented by an autonomous Codex agent and reviewed and tested in the local workspace.
Issues
Fixes #3229
Description
DoToDueTonow leavesdo toalone when it follows an auxiliary and introduces a dictionary-known compound verb, including the reportedcan do to beta testcase.The existing Weir matcher and suggestions are unchanged. A causal use such as
delayed do to beta test resultsis still corrected todue to.Demo
The sentence from #3229 no longer produces a
DoToDueTolint, while causal matches continue to produce the existing suggestion.How Has This Been Tested?
CARGO_INCREMENTAL=0 CARGO_PROFILE_DEV_DEBUG=0 CARGO_PROFILE_TEST_DEBUG=0 cargo test -p harper-core --lib --quietCARGO_INCREMENTAL=0 CARGO_PROFILE_DEV_DEBUG=0 CARGO_PROFILE_TEST_DEBUG=0 cargo test -p harper-core --lib do_to_due_to -- --nocapturecargo fmt --all -- --checkAI Disclosure
If Your PR Implements or Enhances a Linter
Checklist