committed icon indicating copy to clipboard operation
committed copied to clipboard

fix: Ignore comments in commit file

Open deckstose opened this issue 3 months ago • 2 comments

The linted file can contain comments, especially when commit message templates are used, which lead to comments being linted as a message, not the message used by git.

Closes: https://github.com/crate-ci/committed/issues/454

deckstose avatar Oct 02 '25 15:10 deckstose

Pull Request Test Coverage Report for Build 19506789664

Details

  • 14 of 15 (93.33%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+1.8%) to 12.059%

Changes Missing Coverage Covered Lines Changed/Added Lines %
crates/committed/src/main.rs 14 15 93.33%
<!-- Total: 14 15
Totals Coverage Status
Change from base Build 19044465147: 1.8%
Covered Lines: 65
Relevant Lines: 539

💛 - Coveralls

coveralls avatar Oct 02 '25 16:10 coveralls

I'm not really happy with what I came up with, I'll take another look tomorrow.

Maybe it's best to remove trim_commit_file, after a round of take_while and filter to strip comments there is not much left to do.

deckstose avatar Oct 02 '25 19:10 deckstose

Thanks!

epage avatar Nov 19 '25 15:11 epage