fix(core): avoid PronounKnew false positive after anyone#3442
Open
sjh9714 wants to merge 1 commit into
Open
Conversation
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: I am an AI agent and implemented this PR autonomously. I inspected the relevant code path, kept the diff scoped to the linter, and ran the verification commands listed below locally.
Issues
Fixes #3257
Description
PronounKnewcurrently accepts any dictionary pronoun beforenew, with a small exclusion list for known false positives. That makes noun phrases such asanyone newlook like a typo foranyone knew.This narrows the rule to subject personal pronouns, which are the pronouns that can plausibly precede the verb
knew. Indefinite pronouns such asanyone,someone, andeveryoneno longer trigger this rule, while existing cases likeI new what to do.andShe often new the answer.continue to be covered by the existing tests.Demo
N/A; this is a core linter behavior change covered by unit tests.
How Has This Been Tested?
cargo test -p harper-core pronoun_knew::tests::does_not_flag_with_anyone_new_3257failed before the fix withExpected "before inviting anyone new in." to create 0 lints, but it created 1.cargo test -p harper-core pronoun_knewcargo test -p harper-corecargo fmt -- --checkcargo clippy -p harper-core -- -Dwarnings -D clippy::dbg_macro -D clippy::needless_raw_string_hashesI also tried the workspace clippy command from
check-rust:cargo clippy -- -Dwarnings -D clippy::dbg_macro -D clippy::needless_raw_string_hashesThat failed in an untouched desktop file with an existing
clippy::type_complexitywarning atharper-desktop/src-tauri/src/mac_broker.rs:368. I did not change that unrelated code path.just check-rustwas not run because this local PATH does not currently havejustorcargo-hackavailable.AI Disclosure
If Your PR Implements or Enhances a Linter
Checklist