Skip to content

Support --from-last-tag flag #2507

Closed
@benquarmby

Description

@benquarmby

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions