ramsey / conventional-commits

:yo_yo: A PHP library for creating and validating commit messages according to the Conventional Commits specification. Includes a CaptainHook plugin!
MIT License
182 stars 21 forks source link

Add a validate command to CLI to validate commit messages #58

Closed hussainweb closed 1 year ago

hussainweb commented 2 years ago

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

PR checklist

hussainweb commented 2 years ago

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.

Whax commented 2 years ago

Hello,

I'm really interested with this PR, @hussainweb any news ? :)

Thanks

hussainweb commented 1 year ago

@ramsey, I have found why there is an error with PHPStan and created #64. Can you please take a look?

hussainweb commented 1 year ago

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[bot] commented 1 year ago

Codecov Report

Merging #58 (b937c51) into main (a9a668b) will increase coverage by 0.05%. The diff coverage is 100.00%.

Additional details and impacted files [![Impacted file tree graph](https://codecov.io/gh/ramsey/conventional-commits/pull/58/graphs/tree.svg?width=650&height=150&src=pr&token=GRB47TNJB9&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Ben+Ramsey)](https://codecov.io/gh/ramsey/conventional-commits/pull/58?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Ben+Ramsey) ```diff @@ 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](https://codecov.io/gh/ramsey/conventional-commits/pull/58?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Ben+Ramsey) | Coverage Δ | | |---|---|---| | [...ntionalCommits/Console/Command/ValidateCommand.php](https://codecov.io/gh/ramsey/conventional-commits/pull/58/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Ben+Ramsey#diff-c3JjL0NvbnZlbnRpb25hbENvbW1pdHMvQ29uc29sZS9Db21tYW5kL1ZhbGlkYXRlQ29tbWFuZC5waHA=) | `100.00% <100.00%> (ø)` | | | [...tionalCommits/Console/Question/MessageQuestion.php](https://codecov.io/gh/ramsey/conventional-commits/pull/58/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Ben+Ramsey#diff-c3JjL0NvbnZlbnRpb25hbENvbW1pdHMvQ29uc29sZS9RdWVzdGlvbi9NZXNzYWdlUXVlc3Rpb24ucGhw) | `100.00% <100.00%> (ø)` | |
hussainweb commented 1 year ago

Cool. Codecov is happy. I'll work on the docs tomorrow.

hussainweb commented 1 year ago

@ramsey, I completed all the tasks and requesting a review now. Thanks!