Skip to content

fix: restrict missing preposition to linking verbs - #3855

Open
terry-li-hm wants to merge 1 commit into
Automattic:masterfrom
terry-li-hm:agent/fix-missing-preposition-false-positives
Open

fix: restrict missing preposition to linking verbs#3855
terry-li-hm wants to merge 1 commit into
Automattic:masterfrom
terry-li-hm:agent/fix-missing-preposition-false-positives

Conversation

@terry-li-hm

@terry-li-hm terry-li-hm commented Jul 21, 2026

Copy link
Copy Markdown

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 MissingPreposition pattern 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 AUX tag 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 --check
  • cargo test -p harper-core --lib: 5,574 passed and 286 ignored
  • cargo test -p harper-core --test linters test_most_lints
  • Focused CLI checks for the reported examples, nearby grammatical variants, and intended true positives
  • All 12 GitHub Actions checks passed

@terry-li-hm
terry-li-hm force-pushed the agent/fix-missing-preposition-false-positives branch from 53ad2d3 to 99585d6 Compare July 21, 2026 06:13
@terry-li-hm
terry-li-hm marked this pull request as ready for review July 21, 2026 06:56

@hippietrail hippietrail left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one little nit about testing asserts.

"Once the installation is done, you can open your project folder.",
MissingPreposition::default(),
);
assert_no_lints(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Harper has always had a strong preference for one assert per test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Spuriously flagging to insert a preposition

2 participants