Skip to content
This repository was archived by the owner on Dec 19, 2023. It is now read-only.

Add commitlint - use conventional commits consistently #595

Merged

Conversation

BlasiusSecundus
Copy link

This PR proposes to use Conventional Commits on the project from now on and enforce this via the CI.

Commit messages are validated by the CI for each pull request, and aslo adds an easy way to set up a git hook for local development (to catch violations before comitting).

Also adds separated contributing guideline file. Moved there the Contributions section from the readme, as well as added a section about commit messages / commitlint.

Note:

  • Bots may need to be configured to commit according to the specs (but as I see renovate already does that).
  • The "from" commit may also need to be changed depending on the time of merging.

Question / Potential improvements:

  • Is it possible to dynamically check only new commits added by the actual PR?

@BlasiusSecundus BlasiusSecundus marked this pull request as draft April 27, 2021 20:34
@BlasiusSecundus BlasiusSecundus force-pushed the feature/commitlint branch 4 times, most recently from e52e7f9 to d8cd922 Compare May 1, 2021 12:59
@oliemansm
Copy link
Member

Looking good to me, all for it!

@BlasiusSecundus BlasiusSecundus force-pushed the feature/commitlint branch 3 times, most recently from 9cb5de8 to 8ca8ff6 Compare May 3, 2021 17:26
Also add separate contributing guideline file.
@BlasiusSecundus
Copy link
Author

Some improvements since the first version:

  • get HEAD commit from the target repository dynamically (instead of hardcoding the commit hash)
  • run npm audit to check for vulnerabilities in NPM packages installed for commitlint

Some minor adjustments to the workflow:

  • test now depends on commitlint and verify-google-java-format tasks (do not run lengthy test jobs when the build already considered to be failed)
  • sonar depends on test task (avoid "pollution" of sonar results from failed builds)

@BlasiusSecundus BlasiusSecundus marked this pull request as ready for review May 3, 2021 17:54
@oliemansm oliemansm merged commit 6bb1e77 into graphql-java-kickstart:master May 6, 2021
@BlasiusSecundus BlasiusSecundus deleted the feature/commitlint branch June 22, 2021 18:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants