Closed johbo closed 1 year ago
@johbo Thank you for the question. Indeed, your use-case is one that has been discussed here before: https://github.com/compilerla/conventional-pre-commit/issues/9#issuecomment-966490052. Please take a look at that thread for more context.
If I am understanding this proposal / question correctly:
I wonder if it wouldn't be a good improvement to be able to run a check by passing the hashes of a starting and ending commit
(and based on the pseudocode), it seems like the change you request would actually be in pre-commit
itself, to accept a range of commits to run (arbitrary hooks/stages) against?
The TLDR; answer for here is we won't be making any changes to conventional-pre-commit
to support CI, because this is fundamentally incompatible with the git commit-msg
hook/phase.
EDIT to add:
I'll also point out that conventional-pre-commit
is a normal Python package that can be installed from pip
and used in Python code. Perhaps this provides an easier way to accomplish some of what you are trying to do. See the example code in the README.
I've just worked myself through a question how to best integrate the checks into a ci pipeline. Would like to share my experience from the approach and also trigger a question if it's possible to implement support for such use cases.
In our team the context is as follows:
pre-commit
also enabled locally.pre-commit
locally. Latest on the Merge Request the automated feedback would be available.While building this (in our case based on gitlab ci) I found it a particular challenge that I need to extract every commit message manually and then run
pre-commit
to have the message checked. I've reached a working state for us, and still I wonder if it wouldn't be a good improvement to be able to run a check by passing the hashes of a starting and ending commit.As pseudo code it could look something like the following:
The below example shows how I've done it currently and probably helps to understand how I got to the question/suggestion: