Automattic / Automattic/harper

False positive: "had had" & "is is" repetition when grammatically correct

Open
#2,132 4 comments 0 reactions 0 assignees View on GitHub
bug grammar harper-core linting
Dominant language
Rust
Stars
15.4k
Forks
627
Avg merge
1d 12h
Merged PRs (30d)
106

Description

**What got flagged?**
Somewhat frequently, I run into a construction like this:
> I know that that answer is correct

Which as far as I know is perfectly grammatical, if a bit odd written down.

This also occurs with
- "had had" (ie, "the medicine had had no adverse effects")
- "is is" (ie, "What it is is interesting")

However, Harper will flag this as repetition:
image

I don't want to disable the word repetition rule entirely, since it's quite useful for "the" repeats or the like, but it also comes up frequently enough to be a mild hindrance to ignore every time.

**Why is this incorrect?**
In this sentence, the second "that" refers to a previously-mentioned thing (in this case an answer) and the first one is a helper word (I'm sure there's a more accurate explanation but I think it suffices for this issue).

Similar explanations exist for had had and is is

**Example of correct usage:**
I have no idea how one would lint this properly, but neither Google Docs nor Grammarly flags any of the example sentences.

Contributor guide

Open the contributing guide

Research direction

No implementation files or tests are named. Start by reproducing the three example sentences in Harper and locating the repetition rule that flags them; done means grammatical “that that,” “had had,” and “is is” constructions are accepted while useful repeated-word warnings such as “the the” remain.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.