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

Add option to fail on unconventional commits #536

Open
1 task done
ChristopherKlinge opened this issue Mar 6, 2024 · 1 comment
Open
1 task done

Add option to fail on unconventional commits #536

ChristopherKlinge opened this issue Mar 6, 2024 · 1 comment
Labels
feature/request New feature or request good first issue Good for newcomers

Comments

@ChristopherKlinge
Copy link

Is there an existing issue or pull request for this?

  • I have searched the existing issues and pull requests

Feature description

An option to fail generating the changelog if the git history contains commits that do not comply to the conventional commits format would allow using git-cliff as a quality gate. Currently additional tools are needed to implement such behaviour.

Desired solution

Add a new configuration parameter:

# fail if the git history contains commits that are not conventional (default: false)
fail_on_unconventional = true

If git-cliff encounters any unconventional commits, it should print the hashes of all unconventional commits to stderr and exit with a non-zero return code. Outputting the commits gives developers a clear indication as to what they need to fix.

$ git-cliff
Encountered unconventional commits: 12345678, abcdefg

Alternatives considered

There exist other tools that can check compliance with conventional commits. However having to use multiple tools bloats the pipeline.

Additional context

No response

@ChristopherKlinge ChristopherKlinge added the feature/request New feature or request label Mar 6, 2024
Copy link

welcome bot commented Mar 6, 2024

Thanks for opening your first issue at git-cliff! Be sure to follow the issue template! ⛰️

@orhun orhun removed their assignment Mar 6, 2024
@orhun orhun changed the title add option to fail on unconventional commits Add option to fail on unconventional commits Mar 6, 2024
@orhun orhun added the good first issue Good for newcomers label May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature/request New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants