Releases: captainhookphp/captainhook
5.17.0
Changes
- Optimize docker command
- Add uninstall command
- Allow diff filter setting for conditions
- Add php 8.3 support
- Allow run-path to overwrite absolute path
- Decrease action json footprint
If the Cap'n detects a docker exec command
it will make sure the --interactive
flag is set.
Normally I would add --tty
if necessary as well but committing from any Jetbrains IDE would not work then so I disabled the improvement for now.
You can run captainhook uninstall
to remove all scripts from .git/hooks/
.
You can use Diff filters for StagedFile
conditions as well, in case you only want do check the code style for new files.
"action": "phpcs --colors --standard=psr12 {$STAGED_FILES|of-type:php|separated-by: |diff-filter:A}",
"conditions": [
{"exec": "\\CaptainHook\\App\\Hook\\Condition\\FileStaged\\OfType",
"args": [
"php",
["A"]
]}
]
What's Changed
- Feature/use run path as is by @sebastianfeldmann in #221
- Allow diff filter setting for conditions by @sebastianfeldmann in #222
- Decrease action json footprint by @sebastianfeldmann in #223
- Add uninstall command to the Cap'n by @sebastianfeldmann in #224
- Add PHP 8.3 build (experimental) by @sebastianfeldmann in #225
- Add some necessary onions to docker exec by @sebastianfeldmann in #226
Full Changelog: 5.16.4...5.17.0
5.16.4
Changes
- Add label functionality
- Allow
ThatIs
condition to take multivalued options (by Matthieu CODRON)
Actions can be configured with a label that will enhance the output.
{
"action": "\\CaptainHook\\App\\Hook\\Message\\Action\\Beams",
"options": {
"subjectLength": 50,
"bodyLineLength": 72
},
"config": {
"label": "Verify commit message format"
}
}
Will output
commit-msg:
- Verify commit message format : done
5.16.3
Changes
- Fix broken git dependency
5.16.2
Changes
- Add diff filter to conditions
- Fix test coverage
5.16.1
Changes
- Make sure to not add empty lines at the beginning of message subject or body
5.16.0
Changes
- Add issue key injection action
- Add new file condition
- Skip all hooks in CI environments
- Fix
PrepareFromFile
action
The new condition allows to extract issue keys from branch names and append or prepend the key to the commit message subject or body.
The following example will extract JIRA issue keys and append them at the end of the commit message.
{
"action": "\\CaptainHook\\App\\Hook\\Message\\Action\\InjectIssueKeyFromBranch"
"options": {
"regex": "#([A-Z]+\\-[0-9]+)#i",
"into": "body",
"mode": "append",
"prefix": "\\n\\nIssue: "
}
}
Commit message before
This is some nice change
This is a more thorough description of what was changed
so people can understand why the change was done this way.
Commit message after
This is some nice change
This is a more thorough description of what was changed
so people can understand why the change was done this way.
Issue: PROJKEY-1234567
5.15.6
Changes
- BUGFIX: Don't overwrite externally changed msg file
- Improved output
Using CLI actions to prepare commit messages did not work because of an afterAction
issue.
The issue was fixed and you can now prepare a commit message with any CLI command.
5.15.5
Changes
- Add --only-enabled option to installer (by Matthieu CODRON)
5.15.4
Changes
- Add CHANGED_FILES placeholder
- Allow all usage of all ChangedFile Conditions within pre-push hooks
5.15.3
Changes
- Add protected branches option to
BlockFixupAndSquashCommits
Action - Allowed passing multiple hooks for installation (hook argument) via comma (by Olexandr Mazur)