Flag plural "damages" when not used for judicial compensation#2365
Flag plural "damages" when not used for judicial compensation#2365elijah-potter merged 12 commits intoAutomattic:masterfrom
Conversation
elijah-potter
left a comment
There was a problem hiding this comment.
A few nits, but overall this is very close. Thanks!
| /// 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( |
There was a problem hiding this comment.
I'm hesitant to include this right now, since it doesn't seem to be in use anywhere.
There was a problem hiding this comment.
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.
| } | ||
| } | ||
|
|
||
| // TODO: Is this functional-style code better than the for loop version above? |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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!
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 [@​hippietrail](https://github.com/hippietrail) in [#​2759](Automattic/harper#2759) - feat(core): many more Weir rules by [@​elijah-potter](https://github.com/elijah-potter) in [#​2742](Automattic/harper#2742) - feat(chrome-ext): the ability to load/unload Weirpacks by [@​elijah-potter](https://github.com/elijah-potter) in [#​2752](Automattic/harper#2752) - fix(chrome-ext): suggestions being displayed as `0` by [@​elijah-potter](https://github.com/elijah-potter) in [#​2757](Automattic/harper#2757) - feat: PowerShell comments support by [@​elijah-potter](https://github.com/elijah-potter) in [#​2762](Automattic/harper#2762) - feat(core): dictionary additions by [@​scop](https://github.com/scop) in [#​2636](Automattic/harper#2636) - feat(cli): support --no-color flag and NO\_COLOR env var by [@​verri](https://github.com/verri) in [#​2738](Automattic/harper#2738) - fix(core): adjust ToTwoToo linter to ignore transitions by [@​elijah-potter](https://github.com/elijah-potter) in [#​2761](Automattic/harper#2761) - Dictionary curation for Feb 20, 2026 by [@​hippietrail](https://github.com/hippietrail) in [#​2768](Automattic/harper#2768) - build(deps): bump strum from 0.27.2 to 0.28.0 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​2782](Automattic/harper#2782) - build(deps): bump uuid from 1.20.0 to 1.21.0 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​2781](Automattic/harper#2781) - build(deps): bump anyhow from 1.0.101 to 1.0.102 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​2779](Automattic/harper#2779) - feat: for argument sake→for argument's sake by [@​hippietrail](https://github.com/hippietrail) in [#​2774](Automattic/harper#2774) - build(deps): bump libfuzzer-sys from 0.4.10 to 0.4.12 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​2778](Automattic/harper#2778) - fix(core): make the `ItsPossessive` rule more robust by [@​elijah-potter](https://github.com/elijah-potter) in [#​2769](Automattic/harper#2769) - build(deps): bump clap from 4.5.57 to 4.5.60 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​2780](Automattic/harper#2780) - chore: Curate dictionary by [@​anyllmarkevich](https://github.com/anyllmarkevich) in [#​2724](Automattic/harper#2724) - feat: wrote→rote by [@​hippietrail](https://github.com/hippietrail) in [#​2794](Automattic/harper#2794) - fix: don't flag "May of" by [@​hippietrail](https://github.com/hippietrail) in [#​2795](Automattic/harper#2795) - Flag plural "damages" when not used for judicial compensation by [@​hippietrail](https://github.com/hippietrail) in [#​2365](Automattic/harper#2365) - Dictionary curation 2026 02 22 by [@​hippietrail](https://github.com/hippietrail) in [#​2785](Automattic/harper#2785) - feat: add words from fantasy, politics, religion, and adverbs by [@​rauletaveras](https://github.com/rauletaveras) in [#​2643](Automattic/harper#2643) - feat(chrome-ext): enable on all Substack sites by [@​elijah-potter](https://github.com/elijah-potter) in [#​2800](Automattic/harper#2800) - chore: add "one fowl swoop" to "one foul swoop", rename from `InOneFellSwoop` by [@​hippietrail](https://github.com/hippietrail) in [#​2758](Automattic/harper#2758) - fix(core): stop flagging "Czech Republic" as outdated by [@​NaveenPrasanth](https://github.com/NaveenPrasanth) in [#​2797](Automattic/harper#2797) - fix: don't flag "can of" by [@​hippietrail](https://github.com/hippietrail) in [#​2814](Automattic/harper#2814) - feat(core): create rule to correct `now way` by [@​elijah-potter](https://github.com/elijah-potter) in [#​2806](Automattic/harper#2806) - fix(harper-tex): parse triple-hyphens as an em-dash by [@​elijah-potter](https://github.com/elijah-potter) in [#​2805](Automattic/harper#2805) - fix(core): coverage for confusion of `they're`/`there`/`their` by [@​elijah-potter](https://github.com/elijah-potter) in [#​2798](Automattic/harper#2798) - fix(obsidian): avoid command palette crashes from null tooltip entries by [@​stanley-910](https://github.com/stanley-910) in [#​2804](Automattic/harper#2804) - feat(web): add loading message to lazily-loaded editor by [@​elijah-potter](https://github.com/elijah-potter) in [#​2817](Automattic/harper#2817) - feat: support adjectives in "on accident" by [@​hippietrail](https://github.com/hippietrail) in [#​2828](Automattic/harper#2828) - fear: for most part→for the most part by [@​hippietrail](https://github.com/hippietrail) in [#​2827](Automattic/harper#2827) - feat: seam→seem by [@​hippietrail](https://github.com/hippietrail) in [#​2826](Automattic/harper#2826) - feat: out of sink→out of sync/synch by [@​hippietrail](https://github.com/hippietrail) in [#​2829](Automattic/harper#2829) - feat: in hurry→in a hurry by [@​hippietrail](https://github.com/hippietrail) in [#​2825](Automattic/harper#2825) - feat(core): address edge cases in `MissingTo` rule by [@​elijah-potter](https://github.com/elijah-potter) in [#​2818](Automattic/harper#2818) - feat(core): create rule to detect confusion between `principle of` and `principal of` by [@​elijah-potter](https://github.com/elijah-potter) in [#​2799](Automattic/harper#2799) - feat: do diligence→due diligence/do due diligence by [@​hippietrail](https://github.com/hippietrail) in [#​2810](Automattic/harper#2810) - fix(obsidian): find temporary fix for escape button override by [@​elijah-potter](https://github.com/elijah-potter) in [#​2819](Automattic/harper#2819) - feat: all hell break out→all hell break loose by [@​hippietrail](https://github.com/hippietrail) in [#​2813](Automattic/harper#2813) - refactor: heuristic debugging easier by [@​hippietrail](https://github.com/hippietrail) in [#​2508](Automattic/harper#2508) - feat: if only there was→if only there were, etc. by [@​hippietrail](https://github.com/hippietrail) in [#​2823](Automattic/harper#2823) #### New Contributors - [@​anyllmarkevich](https://github.com/anyllmarkevich) made their first contribution in [#​2724](Automattic/harper#2724) - [@​NaveenPrasanth](https://github.com/NaveenPrasanth) made their first contribution in [#​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-->
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