Automattic / Automattic/harper

Should flag questions lacking a question mark.

Open
#2,164 3 comments 0 reactions 0 assignees View on GitHub
enhancement harper-core linting punctuation
Dominant language
Rust
Stars
15.4k
Forks
627
Avg merge
1d 15h
Merged PRs (30d)
106

Description

**The Error**

**Examples:**
1. Do you often see questions like this.
2. Can they be fixed
3. Why does it happen!
4. Am I the only one who is annoyed.

**Potential Edge Cases**
Detecting questions is not as straightforward as you might think when the `?` is missing.
They mostly start a present of past form of "be" or "do", a modal verb such as "can" or "should", or an interrogative word such as "what" or "how". In all the verb cases, the negative contractions are also possible.

But this isn't enough on its own. Many statements also fit this pattern.

Maybe the interrogatives have to precede one of those types of verbs, and maybe a pronoun in subject form has to follow said verb?

**Implementation**
It might be easier to implement if there were a version of `ExprLinter` that worked on sentences rather than "chunks".

Contributor guide

Open the contributing guide

Research direction

Start by locating the existing ExprLinter and understanding how it processes chunks, then assess what a sentence-level version would need for this rule. Use the examples and listed verb, contraction, interrogative, and subject patterns as the behavior to evaluate; done means reliably flagging questions without a question mark while avoiding matching ordinary statements.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
devtools
Issue type
Feature
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.