test: add coverage for BodyValidator leading blank line edge cases - #491
test: add coverage for BodyValidator leading blank line edge cases#491RubenSanosh wants to merge 2 commits into
Conversation
✅ Deploy Preview for commit-check ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdded three ChangesBodyValidator tests
Estimated code review effort: 1 (Trivial) | ~5 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Merging this PR will improve performance by 97.16%
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ⚡ | test_empty_message_passes |
1,475.5 µs | 748.4 µs | +97.16% |
| 🆕 | test_validate_with_leading_blank_lines_and_body |
N/A | 815.7 µs | N/A |
| 🆕 | test_validate_with_leading_blank_lines_no_body |
N/A | 129.3 µs | N/A |
| 🆕 | test_validate_with_whitespace_only_message |
N/A | 130.1 µs | N/A |
Tip
Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.
Comparing RubenSanosh:test/body-validator-edge-cases (cd4a018) with main (56e6e36)
Footnotes
-
115 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩



Closes #490
Added 3 test cases to TestBodyValidator covering leading-blank-line and
whitespace-only commit messages, matching the corrected expected results
in the updated issue description.
Note: lines 556-558 in BodyValidator.validate() still show as uncovered.
I believe this branch is unreachable in practice, since _get_commit_message()
strips the message before validate() runs, a message can never have
content on the first line followed by surviving blank lines by the time
it reaches this check. Happy to look into removing that dead code in a
follow up if useful, just flagging it here for visibility.
Summary by CodeRabbit