Skip to content

refactor: two-digit decade support#2911

Merged
elijah-potter merged 19 commits intoAutomattic:masterfrom
hippietrail:decades-389-two-digit-refactor
Mar 12, 2026
Merged

refactor: two-digit decade support#2911
elijah-potter merged 19 commits intoAutomattic:masterfrom
hippietrail:decades-389-two-digit-refactor

Conversation

@hippietrail
Copy link
Collaborator

@hippietrail hippietrail commented Mar 11, 2026

Issues

Further work on #389

Description

Adds support for 2-digit decades.
It's extremely common that people always write decades followed by an apostrophe as though the numbers possess something. Correctly, when referring to a decade of someone's life there should be no apostrophe, and when referring to a decade of history, the apostrophe should be before the numbers, representing the elided first two digits:

  • In my 20's I was a computer nerd → In my 20s I was a computer nerd
  • In the 70's, Disco was king → In the '70s, Disco was king

How Has This Been Tested?

Many unit tests harvested from GitHub. As with the 4-digit support, the linter can't yet discern all the possibilities. So the sentences are still included but ignored so future devs may continue iterating on the module without having to collect more example sentences.

Checklist

  • I have performed a self-review of my own code
  • I have added tests to cover my changes

@hippietrail hippietrail marked this pull request as ready for review March 12, 2026 03:52
Copy link
Collaborator

@elijah-potter elijah-potter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! Great stuff. I'm a fan of all of those tests.

@elijah-potter elijah-potter added this pull request to the merge queue Mar 12, 2026
@hippietrail
Copy link
Collaborator Author

Awesome! Great stuff. I'm a fan of all of those tests.

I'm thinking of ways to make tests more data-driven generally.

Merged via the queue into Automattic:master with commit 426051e Mar 12, 2026
11 checks passed
@hippietrail hippietrail deleted the decades-389-two-digit-refactor branch March 12, 2026 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants