Automattic / Automattic/harper

a/an and acronyms

Open
#534 6 comments 2 reactions 0 assignees View on GitHub
linting
Dominant language
Rust
Stars
15.4k
Forks
627
Avg merge
1d 15h
Merged PRs (30d)
106

Description

While the rule for using either `a` or `an` before *regular* words is easy-ish, it's trickier when it comes to acronyms:

> Use a or an before an acronym or other abbreviation depending on how it is pronounced, not how it is written. If the abbreviation starts with a consonant sound when read aloud, use a; if it starts with a vowel sound, use an.

This is currently not implemented in harper, and source of false-positives. I think the best compromise for now would be to not detect any issue when `a` or `an` is used in front of an acronym.

## example

```
he combined those two properties to execute a ROP payload right after each ■ Incorrect indefinite article.
```

## sources

- https://editorsmanual.com/articles/indefinite-article-a-an-with-abbreviations/
- https://www.grammar.com/a-vs-an-when-to-use/

Contributor guide

Open the contributing guide

Research direction

The issue names no files or tests. Start by locating the indefinite-article diagnostic and its existing test coverage, then reproduce the ROP example. Done means an acronym after “a” or “an” no longer triggers the incorrect-indefinite-article diagnostic, with a regression test covering the behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.