Automattic / Automattic/harper

Can't correct `isnt'` into `isn't` without leaving a residual apostrophe → `isn't'`

Open
#4,285 0 comments 0 reactions 0 assignees View on GitHub
bug enhancement linting punctuation spelling
Dominant language
Rust
Stars
15.4k
Forks
627
Avg merge
1d 15h
Merged PRs (30d)
106

Description

https://github.com/user-attachments/assets/805f6efa-91c6-4596-a560-896350123adc

This is because Harper doesn't treat trailing apostrophes as part of the word. Which is reasonable since the `'` apostrophe is ambiguous meaning "apostrophe", "opening single quote", or "closing single quote". And even `’` is ambiguous meaning "apostrophe" and "closing single quote".

A dedicated linter would be able to check for any out-of-vocabulary word immediately followed by `'` or `’` and/or a list of all contractions where the `'` is the penultimate character given that `wont'` and `cant'` might be this same mistake.

This will surely clash with `SpellCheck`, so we really need to find a more architectural solution to clashing linters when ignoring one of them can result in ignoring the fix.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the `isnt'` correction and examine how the spell-check and other linters report or suppress fixes. Done should mean correcting the malformed contraction removes the residual apostrophe while preserving valid spell-check and linter fixes; the issue does not name a file or test to run.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
devtools
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.