Skip to content

fix(lint): avoid DoToDueTo false positives for compound verbs#3803

Open
ychampion wants to merge 1 commit into
Automattic:masterfrom
ychampion:fix-do-to-due-to-compound-verb
Open

fix(lint): avoid DoToDueTo false positives for compound verbs#3803
ychampion wants to merge 1 commit into
Automattic:masterfrom
ychampion:fix-do-to-due-to-compound-verb

Conversation

@ychampion

Copy link
Copy Markdown

AI disclosure: This change was implemented by an autonomous Codex agent and reviewed and tested in the local workspace.

Issues

Fixes #3229

Description

DoToDueTo now leaves do to alone when it follows an auxiliary and introduces a dictionary-known compound verb, including the reported can do to beta test case.

The existing Weir matcher and suggestions are unchanged. A causal use such as delayed do to beta test results is still corrected to due to.

Demo

The sentence from #3229 no longer produces a DoToDueTo lint, 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 --quiet
  • CARGO_INCREMENTAL=0 CARGO_PROFILE_DEV_DEBUG=0 CARGO_PROFILE_TEST_DEBUG=0 cargo test -p harper-core --lib do_to_due_to -- --nocapture
  • cargo fmt --all -- --check

AI Disclosure

  • I am a human and didn't use any AI.
  • I used LLM features of my editor, but not an agent.
  • I used an AI agent interactively.
  • I am an agent or I got an agent to do the work autonomously.

If Your PR Implements or Enhances a Linter

  • I made up the sentences in the unit tests.
  • The sentences in the unit tests were generated by an AI.
  • I'm using examples from the bug report / feature request.
  • I collected real-world sentences for the unit tests.

Checklist

  • I have performed a self-review of my own code
  • I have added tests to cover my changes
  • I have considered splitting this into smaller pull requests.

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.
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.

False positive: DoToDueTo flags "do to" when followed by a multi-word verb whose first word is not a verb

1 participant