You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
After running blt setup, the pre-commit git hook is added and fires when git commit is run. It relies on a project.prefix setting in blt.yml which does not exist by default.
$ git commit -m "commit"
Executing .git/hooks/pre-commit...
Untracked files are present, this may impact the validity of pre-commit checks.
> validate:twig:lint:files
Linting twig files...
All Twig files contain valid syntax.
> validate:yaml:lint:files
Linting YAML files...
Your local code has passed git pre-commit validation.
Executing .git/hooks/commit-msg...
Validating commit message syntax...
[error] Invalid commit message!
Commit messages must conform to the regex /(^${project.prefix}-[0-9]+(: )[^ ].{15,}\.)|(Merge branch (.)+)/
To Reproduce
Steps to reproduce the behavior, ideally starting from a fresh install of BLT:
Run acli new and select the acquia/drupal-recommended-project option
Run blt setup
`Git add . ; git commit -m "meh"
Observe error message above
** Expected Behavior **
BLT either sets a project prefix or ignores the prefix and ticket number portion of the commit message check.
The text was updated successfully, but these errors were encountered:
I don't think the root cause here is exactly that the project prefix isn't set, since you'd get the same error if it was set (given that your commit message is "meh"). But I take your point, this isn't a great user experience.
I think we have two options:
Set a default project prefix (in BLT 11, it was just "BLT"). We already link to a message about how to change / disable this check in the error output. Every user will have to change this out of the box, which doesn't seem great.
Disable commit message validation by default. A bit more user-friendly, but people aren't likely to discover the feature on their own.
The ${project.prefix} in the error message would be replaced with the project prefix if one was set.
My preference would be to just set a default prefix. I think the validation is very useful and, like you say, people aren't likely to find it on their own.
% blt --version
BLT 12.3.0
Describe the bug
After running
blt setup
, the pre-commit git hook is added and fires when git commit is run. It relies on a project.prefix setting in blt.yml which does not exist by default.To Reproduce
Steps to reproduce the behavior, ideally starting from a fresh install of BLT:
acli new
and select theacquia/drupal-recommended-project
optionblt setup
** Expected Behavior **
BLT either sets a project prefix or ignores the prefix and ticket number portion of the commit message check.
The text was updated successfully, but these errors were encountered: