Skip to content

Conversation

@BinToss
Copy link
Contributor

@BinToss BinToss commented Jul 18, 2023

This PR changes the "Conventional Commit" RegEx to be more in line with Convention Commits 1.0.0 and commitlint specifications.

This PR also adds notes for configuring GitVersion and semantic-release to generate the same version.

I'm considering adding a separate section for the angular commit format since that is what semantic-release defaults to. It's...nearly identical to Conventional Commits, but is more concrete in its specifications e.g. a reverted commit's header (type(scope): header message) is to be the revert commit's header message.

Related Issue

resolves #3627

Motivation and Context

I use GitVersion for stamping .NET assemblies and NuGet packages with version information, but I use semantic-release for git tags, release commits, change logs, release notes, GitHub releases, and more.

Because they both have commit analysis and version generation capabilities, I've found that ensuring both generate the same version can be quite finicky.

How Has This Been Tested?

https://regexr.com/7h6lv

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@BinToss BinToss marked this pull request as ready for review July 18, 2023 09:22
@arturcic arturcic requested a review from asbjornu July 18, 2023 09:27
Copy link
Member

@asbjornu asbjornu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't use conventional commits myself, but this looks reasonable to me.

@asbjornu
Copy link
Member

I think we should just set check_external_hash to false in HTMLProofer to turn it green.

@BinToss
Copy link
Contributor Author

BinToss commented Aug 11, 2023

I didn't thoroughly test the theory, but I believe it's failing due to many of GitHub's "anchored" links not matching to an element's id attribute. That is, GitHub links "#L8" to line 8 of a given file via JavaScript and classes, but the HTML proofer is probably looking for something like <a id="L8" />.

If this is not respected in GitVersion's config...
...or if the revert rule is not overridden in semantic-release's config...
...then semantic-release may generate a different PATCH version than GitVersion.
@arturcic arturcic force-pushed the bintoss/fixConventionalCommitPatchRule branch from e0ce22e to 7a388f7 Compare September 4, 2023 22:32
@arturcic arturcic merged commit abb2bfa into GitTools:main Sep 4, 2023
@arturcic arturcic added this to the 6.x milestone Sep 4, 2023
@mergify
Copy link
Contributor

mergify bot commented Sep 4, 2023

Thank you @BinToss for your contribution!

@arturcic arturcic removed this from the 6.x milestone Sep 4, 2023
@BinToss BinToss deleted the bintoss/fixConventionalCommitPatchRule branch September 11, 2023 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Docs] Fix "Conventional Commit" commit message format

3 participants