Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support --from-last-tag flag #2507

Closed
1 of 4 tasks
benquarmby opened this issue Mar 15, 2021 · 0 comments · Fixed by #4110
Closed
1 of 4 tasks

Support --from-last-tag flag #2507

benquarmby opened this issue Mar 15, 2021 · 0 comments · Fixed by #4110

Comments

@benquarmby
Copy link
Contributor

benquarmby commented Mar 15, 2021

Please consider adding first class support for automatically linting the commit range --from-last-tag which would be equivalent to commitlint --from $(git describe --always --first-parent)

Affected packages

  • cli
  • core
  • prompt
  • config-angular

Context

We lint commit messages on new PRs starting from the last conventional release cut by lerna. Capturing the last tag using git describe is the most reliable way to detect the last release (lerna itself does this). While using the above command as a package script gets the job done, it is hacky and does not work cross-platform (i.e. on Windows).

A known limitation is that git will report the current hash (using the --always flag) for brand new repositories that don't have releases or tags yet. In that case, commitlint would lint the current hash which seems reasonable until the first release is cut.

Your Environment

Executable Version
commitlint --version 12.0.1
git --version 2.24.3
node --version 12.21.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

2 participants