Skip to content

Conversation

@hippietrail
Copy link
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
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!

/// 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
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
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.

}
}

// TODO: Is this functional-style code better than the for loop version above?
Copy link
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
Collaborator Author

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 let both in specifically to get your feedback in PR review so I'll keep the functional version - thanks!

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