fix: restrict missing preposition to linking verbs - #3855
Open
terry-li-hm wants to merge 1 commit into
Open
Conversation
terry-li-hm
force-pushed
the
agent/fix-missing-preposition-false-positives
branch
from
July 21, 2026 06:13
53ad2d3 to
99585d6
Compare
terry-li-hm
marked this pull request as ready for review
July 21, 2026 06:56
hippietrail
requested changes
Jul 21, 2026
hippietrail
left a comment
Collaborator
There was a problem hiding this comment.
Just one little nit about testing asserts.
| "Once the installation is done, you can open your project folder.", | ||
| MissingPreposition::default(), | ||
| ); | ||
| assert_no_lints( |
Collaborator
There was a problem hiding this comment.
Harper has always had a strong preference for one assert per test.
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.
Note
This pull request was produced with assistance from GLM-5.2 and OpenAI Codex. The resulting patch was independently reviewed and verified before submission.
Fixes #1585.
The
MissingPrepositionpattern currently accepts any auxiliary verb before its adjective and object slots. That makes modal auxiliaries such as "can" and non-copular uses such as "has" look like the rule's intended copular construction.This change requires that slot to retain its
AUXtag and also match the existing linking-verb predicate. It adds regression coverage for the three public false positives reported in the issue and a corpus edge case exposed by CI, while preserving the rule's existing true-positive cases.Validation:
cargo fmt --all --checkcargo test -p harper-core --lib: 5,574 passed and 286 ignoredcargo test -p harper-core --test linters test_most_lints