| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
WalkthroughUpdated the commit subject validator regex in commit_check/engine.py to support conventional-commit breaking-change syntax (e.g., feat!:, fix(scope)!:). Added two unit tests covering breaking-change cases in tests/engine_test.py. No exported/public API changes. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested labelsdeveloper Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
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. ❤️ ShareComment @coderabbitai help to get the list of available commands and usage tips. |
Sorry, something went wrong.
|
Sorry, something went wrong.
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #305 +/- ##
=======================================
Coverage 87.29% 87.29%
=======================================
Files 8 8
Lines 685 685
=======================================
Hits 598 598
Misses 87 87 ☔ View full report in Codecov by Sentry.
|
Sorry, something went wrong.
CodSpeed Performance ReportMerging #305 will not alter performanceComparing bugfix/fix-301 (cd957d9) with main (213b6d2) Summary✅ 27 untouched Footnotes
|
Sorry, something went wrong.
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)tests/engine_test.py (1)📜 Review details782-800: LGTM! Tests adequately cover breaking change scenarios.
The two new test cases provide good coverage for the breaking change notation feature:
- Without scope: feat!:
- With scope: fix(auth)!:
Both tests verify that valid imperative verbs still pass validation with the breaking change marker present.
Consider adding a negative test case to verify that breaking change notation with non-imperative verbs still fails:
def test_validate_with_breaking_change_non_imperative(self): """Test validation with breaking change and non-imperative verb.""" rule = ValidationRule(check="imperative") validator = SubjectImperativeValidator(rule) context = ValidationContext(stdin_text="feat!: updated authentication system") with patch("commit_check.util._print_failure"): result = validator.validate(context) assert result == ValidationResult.FAILThis would explicitly confirm that the breaking change syntax doesn't bypass imperative mood validation.
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📥 CommitsReviewing files that changed from the base of the PR and between 213b6d2 and cd957d9.
📒 Files selected for processing (2)📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Ensure tests run via pytest -v and cover commit, branch, author, and CLI behaviors
Files:
Learnt from: CR PR: commit-check/commit-check#0 File: .github/copilot-instructions.md:0-0 Timestamp: 2025-10-03T10:28:06.793Z Learning: Applies to commit_check/commit.py : Support breaking change notation with ! (e.g., feat!: breaking change)
Learnt from: CR PR: commit-check/commit-check#0 File: .github/copilot-instructions.md:0-0 Timestamp: 2025-10-03T10:28:06.793Z Learning: Applies to commit_check/commit.py : Support optional scope in commits, e.g., feat(api): add endpoint
Learnt from: CR PR: commit-check/commit-check#0 File: .github/copilot-instructions.md:0-0 Timestamp: 2025-10-03T10:28:06.793Z Learning: Applies to commit_check/commit.py : Support breaking change notation with ! (e.g., feat!: breaking change)
Applied to files:
commit_check/engine.py (12)⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (18)
- SubjectImperativeValidator (192-213)
- ValidationContext (27-32)
- validate (42-44)
- validate (100-114)
- validate (137-145)
- validate (241-250)
- validate (287-303)
- validate (309-329)
- validate (356-370)
- validate (393-418)
- validate (441-456)
- ValidationResult (19-23)
commit_check/engine.py (1)203-204: LGTM! Regex correctly supports breaking change notation.
The regex update properly adds support for the conventional commit breaking change indicator (!) while maintaining backward compatibility. The pattern correctly handles:
- feat!: description
- fix(scope)!: description
- All existing formats without !
Based on learnings.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
closes #301
Summary by CodeRabbit