Skip to content

Flag plural "damages" when not used for judicial compensation#2365

Merged
elijah-potter merged 12 commits intoAutomattic:masterfrom
hippietrail:damages-954
Feb 24, 2026
Merged

Flag plural "damages" when not used for judicial compensation#2365
elijah-potter merged 12 commits intoAutomattic:masterfrom
hippietrail:damages-954

Conversation

@hippietrail
Copy link
Copy Markdown
Collaborator

Issues

Resolves #954

Description

(Work in progress)
Tries to determine if uses of "damages" are noun senses that don't refer to compensation awarded by a court etc.

How Has This Been Tested?

Unit tests based on real-world sentences from GitHub and maybe elsewhere on the internet.

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 December 21, 2025 07:10
Copy link
Copy Markdown
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.

A few nits, but overall this is very close. Thanks!

Comment thread harper-core/src/linting/mod.rs Outdated
/// A string with ANSI escape codes where:
/// - Context tokens are dimmed before and after the matched tokens in normal weight.
/// - Markup and formatting text hidden in whitespace tokens is filtered out.
pub fn format_lint_match(
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm hesitant to include this right now, since it doesn't seem to be in use anywhere.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I'm hesitant to include this right now, since it doesn't seem to be in use anywhere.

Oh sorry that has its own PR. I use it in every new linter I work on but remove it before making the PR. Which I see I forgot to do this time sorry. Officially in today's inbox now.

Comment thread harper-core/src/linting/damages.rs Outdated
}
}

// TODO: Is this functional-style code better than the for loop version above?
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I personally find the functional code easier to read. I imagine they compile down to something similar once LLVM gets its hands on it. If you prefer the loop version, would you mind removing this comment for clarity?

Copy link
Copy Markdown
Collaborator Author

@hippietrail hippietrail Jan 16, 2026

Choose a reason for hiding this comment

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

I personally find the functional code easier to read. I imagine they compile down to something similar once LLVM gets its hands on it. If you prefer the loop version, would you mind removing this comment for clarity?

I often find functional harder to reason about but when I get such problems working with loops I love to see how our robotic overlord friends can refactor them into functional code, which I find cool and interesting.

I left both in specifically to get your feedback in PR review so I'll keep the functional version - thanks!

@elijah-potter elijah-potter added this pull request to the merge queue Feb 24, 2026
Merged via the queue into Automattic:master with commit cba5980 Feb 24, 2026
11 checks passed
@hippietrail hippietrail deleted the damages-954 branch February 25, 2026 05:23
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Mar 3, 2026
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [Automattic/harper/harper-ls](https://github.com/Automattic/harper) | minor | `v1.8.0` → `v1.9.0` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>Automattic/harper (Automattic/harper/harper-ls)</summary>

### [`v1.9.0`](https://github.com/Automattic/harper/releases/tag/v1.9.0)

[Compare Source](Automattic/harper@v1.8.0...v1.9.0)

#### What's Changed

- Propagating newer methods of `SequenceExpr` through the codebase by [@&#8203;hippietrail](https://github.com/hippietrail) in [#&#8203;2759](Automattic/harper#2759)
- feat(core): many more Weir rules by [@&#8203;elijah-potter](https://github.com/elijah-potter) in [#&#8203;2742](Automattic/harper#2742)
- feat(chrome-ext): the ability to load/unload Weirpacks by [@&#8203;elijah-potter](https://github.com/elijah-potter) in [#&#8203;2752](Automattic/harper#2752)
- fix(chrome-ext): suggestions being displayed as `0` by [@&#8203;elijah-potter](https://github.com/elijah-potter) in [#&#8203;2757](Automattic/harper#2757)
- feat: PowerShell comments support by [@&#8203;elijah-potter](https://github.com/elijah-potter) in [#&#8203;2762](Automattic/harper#2762)
- feat(core): dictionary additions by [@&#8203;scop](https://github.com/scop) in [#&#8203;2636](Automattic/harper#2636)
- feat(cli): support --no-color flag and NO\_COLOR env var by [@&#8203;verri](https://github.com/verri) in [#&#8203;2738](Automattic/harper#2738)
- fix(core): adjust ToTwoToo linter to ignore transitions by [@&#8203;elijah-potter](https://github.com/elijah-potter) in [#&#8203;2761](Automattic/harper#2761)
- Dictionary curation for Feb 20, 2026 by [@&#8203;hippietrail](https://github.com/hippietrail) in [#&#8203;2768](Automattic/harper#2768)
- build(deps): bump strum from 0.27.2 to 0.28.0 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2782](Automattic/harper#2782)
- build(deps): bump uuid from 1.20.0 to 1.21.0 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2781](Automattic/harper#2781)
- build(deps): bump anyhow from 1.0.101 to 1.0.102 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2779](Automattic/harper#2779)
- feat: for argument sake→for argument's sake by [@&#8203;hippietrail](https://github.com/hippietrail) in [#&#8203;2774](Automattic/harper#2774)
- build(deps): bump libfuzzer-sys from 0.4.10 to 0.4.12 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2778](Automattic/harper#2778)
- fix(core): make the `ItsPossessive` rule more robust by [@&#8203;elijah-potter](https://github.com/elijah-potter) in [#&#8203;2769](Automattic/harper#2769)
- build(deps): bump clap from 4.5.57 to 4.5.60 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2780](Automattic/harper#2780)
- chore: Curate dictionary by [@&#8203;anyllmarkevich](https://github.com/anyllmarkevich) in [#&#8203;2724](Automattic/harper#2724)
- feat: wrote→rote by [@&#8203;hippietrail](https://github.com/hippietrail) in [#&#8203;2794](Automattic/harper#2794)
- fix: don't flag "May of" by [@&#8203;hippietrail](https://github.com/hippietrail) in [#&#8203;2795](Automattic/harper#2795)
- Flag plural "damages" when not used for judicial compensation by [@&#8203;hippietrail](https://github.com/hippietrail) in [#&#8203;2365](Automattic/harper#2365)
- Dictionary curation 2026 02 22 by [@&#8203;hippietrail](https://github.com/hippietrail) in [#&#8203;2785](Automattic/harper#2785)
- feat: add words from fantasy, politics, religion, and adverbs by [@&#8203;rauletaveras](https://github.com/rauletaveras) in [#&#8203;2643](Automattic/harper#2643)
- feat(chrome-ext): enable on all Substack sites by [@&#8203;elijah-potter](https://github.com/elijah-potter) in [#&#8203;2800](Automattic/harper#2800)
- chore: add "one fowl swoop" to "one foul swoop", rename from `InOneFellSwoop` by [@&#8203;hippietrail](https://github.com/hippietrail) in [#&#8203;2758](Automattic/harper#2758)
- fix(core): stop flagging "Czech Republic" as outdated by [@&#8203;NaveenPrasanth](https://github.com/NaveenPrasanth) in [#&#8203;2797](Automattic/harper#2797)
- fix: don't flag "can of" by [@&#8203;hippietrail](https://github.com/hippietrail) in [#&#8203;2814](Automattic/harper#2814)
- feat(core): create rule to correct `now way` by [@&#8203;elijah-potter](https://github.com/elijah-potter) in [#&#8203;2806](Automattic/harper#2806)
- fix(harper-tex): parse triple-hyphens as an em-dash by [@&#8203;elijah-potter](https://github.com/elijah-potter) in [#&#8203;2805](Automattic/harper#2805)
- fix(core): coverage for confusion of `they're`/`there`/`their` by [@&#8203;elijah-potter](https://github.com/elijah-potter) in [#&#8203;2798](Automattic/harper#2798)
- fix(obsidian): avoid command palette crashes from null tooltip entries by [@&#8203;stanley-910](https://github.com/stanley-910) in [#&#8203;2804](Automattic/harper#2804)
- feat(web): add loading message to lazily-loaded editor by [@&#8203;elijah-potter](https://github.com/elijah-potter) in [#&#8203;2817](Automattic/harper#2817)
- feat: support adjectives in "on accident" by [@&#8203;hippietrail](https://github.com/hippietrail) in [#&#8203;2828](Automattic/harper#2828)
- fear: for most part→for the most part by [@&#8203;hippietrail](https://github.com/hippietrail) in [#&#8203;2827](Automattic/harper#2827)
- feat: seam→seem by [@&#8203;hippietrail](https://github.com/hippietrail) in [#&#8203;2826](Automattic/harper#2826)
- feat: out of sink→out of sync/synch by [@&#8203;hippietrail](https://github.com/hippietrail) in [#&#8203;2829](Automattic/harper#2829)
- feat: in hurry→in a hurry by [@&#8203;hippietrail](https://github.com/hippietrail) in [#&#8203;2825](Automattic/harper#2825)
- feat(core): address edge cases in `MissingTo` rule by [@&#8203;elijah-potter](https://github.com/elijah-potter) in [#&#8203;2818](Automattic/harper#2818)
- feat(core): create rule to detect confusion between `principle of` and `principal of` by [@&#8203;elijah-potter](https://github.com/elijah-potter) in [#&#8203;2799](Automattic/harper#2799)
- feat: do diligence→due diligence/do due diligence by [@&#8203;hippietrail](https://github.com/hippietrail) in [#&#8203;2810](Automattic/harper#2810)
- fix(obsidian): find temporary fix for escape button override by [@&#8203;elijah-potter](https://github.com/elijah-potter) in [#&#8203;2819](Automattic/harper#2819)
- feat: all hell break out→all hell break loose by [@&#8203;hippietrail](https://github.com/hippietrail) in [#&#8203;2813](Automattic/harper#2813)
- refactor: heuristic debugging easier by [@&#8203;hippietrail](https://github.com/hippietrail) in [#&#8203;2508](Automattic/harper#2508)
- feat: if only there was→if only there were, etc. by [@&#8203;hippietrail](https://github.com/hippietrail) in [#&#8203;2823](Automattic/harper#2823)

#### New Contributors

- [@&#8203;anyllmarkevich](https://github.com/anyllmarkevich) made their first contribution in [#&#8203;2724](Automattic/harper#2724)
- [@&#8203;NaveenPrasanth](https://github.com/NaveenPrasanth) made their first contribution in [#&#8203;2797](Automattic/harper#2797)

**Full Changelog**: <Automattic/harper@v1.8.0...v1.9.0>

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My40Ni42IiwidXBkYXRlZEluVmVyIjoiNDMuNDYuNiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90IiwiYXV0b21hdGlvbjpib3QtYXV0aG9yZWQiLCJkZXBlbmRlbmN5LXR5cGU6Om1pbm9yIl19-->
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.

Should flag plural "damages" used for anything other than in the legal compensation sense.

2 participants