conventional-commits
conventional-commits copied to clipboard
Add a validate command to CLI to validate commit messages
Description
As discussed in https://github.com/ramsey/conventional-commits/issues/57#issuecomment-1191824713, this PR adds a command to validate a commit message
Motivation and context
More details in #57 and #25.
How has this been tested?
So far, I have added a few tests and mainly tested this manually. This PR is WIP and I will add more tests.
Types of changes
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
PR checklist
- [x] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [x] I have read the CONTRIBUTING.md document.
- [ ] I have added tests to cover my changes.
I am not sure what to do with the phpstan error in the static analysis stage. FWIW, this breaks on the main branch as well. If I find a fix, I'll submit another PR for that.
Hello,
I'm really interested with this PR, @hussainweb any news ? :)
Thanks
@ramsey, I have found why there is an error with PHPStan and created #64. Can you please take a look?
I'm happy to see most relevant checks are passing now. More tests and docs next. ~I can't do that today though. Maybe tomorrow or later this week.~
Codecov Report
Merging #58 (b937c51) into main (a9a668b) will increase coverage by
0.05%. The diff coverage is100.00%.
Additional details and impacted files
@@ Coverage Diff @@
## main #58 +/- ##
============================================
+ Coverage 98.71% 98.76% +0.05%
- Complexity 286 296 +10
============================================
Files 37 39 +2
Lines 779 813 +34
============================================
+ Hits 769 803 +34
Misses 10 10
| Impacted Files | Coverage Δ | |
|---|---|---|
| ...ntionalCommits/Console/Command/ValidateCommand.php | 100.00% <100.00%> (ø) |
|
| ...tionalCommits/Console/Question/MessageQuestion.php | 100.00% <100.00%> (ø) |
Cool. Codecov is happy. I'll work on the docs tomorrow.
@ramsey, I completed all the tasks and requesting a review now. Thanks!