Automattic / Automattic/harper
"DB" flagged as an `OrthographicConsistency` mistake and cannot be added to any dictionary.
- Dominant language
- Rust
- Stars
- 15.4k
- Forks
- 627
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 106
Description
**What got flagged?**
"DB" <- The canonical dictionary spelling is `db`.
**Why is this incorrect?**
"DB" is the standard initialism for "data base," or the more modern compound "database." This is similar to "TV" and "television." Harper accepts "TV" as a valid word, but rejects "DB." The only available code actions are `Replace with: "db"` and `Ignore Harper error.` The user cannot add "DB" to any dictionary.
Testing further, other arbitrary two-letter initialisms "KJ," "PJ," and "EF," could be added to a dictionary. This problem appears to be isolated to "DB."
**Example of correct usage:**
"The DB schema lists tables and columns."
**Bonus bug found while testing:**
Curious, I tried "D.B." which was flagged as a `SpellCheck` mistake, with "Dab," "Deb," and "Debt" listed as possible replacements. Per the style guides listed below, "D.B." should be flagged as an improper way to write the initialism "DB," if anything. The same is true for `T.V.` which listed "TVA," "E.g." and "I.e." as possible replacements, instead of "TV."
**Sources:**
> Periods are not used with abbreviations in APA Style (e.g., write “FBI” and “PhD” not “F.B.I.” and “Ph.D.”).
[APA Style Guidelines](https://apastyle.apa.org/style-grammar-guidelines/abbreviations)
> As a general rule, identifiers (e.g., ID and DB) should also be capitalized similar to their usage in English prose.
[Go Style Decisions](https://google.github.io/styleguide/go/decisions.html#initialisms)
> Modern style is to use a full point (full stop, period) after a shortening (see § Shortenings for exceptions) but no full points within an acronym or initialism.
[Wikipedia's Manual of Style](https://en.wikipedia.org/wiki/Wikipedia:Manual_of_Style/Abbreviations#Full_points_(periods))
Contributor guide
Research direction
Start by reproducing the OrthographicConsistency behavior for “DB” and the SpellCheck behavior for “D.B.” and “T.V.”, then trace the rule and dictionary handling behind those diagnostics. Done means “DB” can be accepted or added to a dictionary, while dotted forms receive the intended initialism guidance; add regression coverage for the reported cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- devtools, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 65/100