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
178 stars 19 forks source link

lower case converter wrong validation #68

Open toniop99 opened 1 year ago

toniop99 commented 1 year ago

I think this is kind a bug but I am not sure if it could be the valid implementation of a lower case converter

Maybe is more related to jawira/case-converter than with that package.

Steps to reproduce

If we config the package to use "descriptionCase": "lower", if we try to commit the following commit type(scope): 1.1.1 to release a new version, the commit message validation will fail as it detect that the versioning is not in lower format

Screenshots or output

Image showing error

toniop99 commented 1 year ago

Definitely, I think that what I am commenting does not make sense, since there would be no way to differentiate the text from other types such as the dot conversion.

Sorry for the waste of time

ramsey commented 1 year ago

Your comment makes sense, and this has frustrated me, too. If you can think of a good way to validate the commit message like this, let me know. I'm willing to make that change.

toniop99 commented 1 year ago

I think we can try to validate if the description is for versioning and not apply descriptionCaseValidator and descriptionEndMarkValidator in that case. For that pupose, we can use the regex specified in the semserver website as official/recommended option.

Description validation

In addition, to generalize this behavior, the following options can be added to the configuration:

This is what comes to mind. Let me know what you think!