Collection of pre-commit hooks for JIRA workflow.
- pre-commit
- Docker. Docker daemon should be enabled whenever you make a commit and want to use pre-commit-jira hooks
-
Put the following configuration into your
.pre-commit-config.yaml
file:repos: - repo: https://github.com/batovpasha/pre-commit-jira rev: v1.0.0 hooks: - id: add-jira-ticket
-
Update the hooks to latest version:
pre-commit autoupdate
-
Install the hooks:
pre-commit install --hook-type commit-msg
-
Start using. Example:
git checkout -b feature/TICKET-123-some-feature git commit --allow-empty -m "feat: add new feature" # The next command will show the latest commit message git log -1 --pretty=%B # => feat: TICKET-123 add new feature
- Everything from usage prerequisites
- Leiningen
- Clojure
lein test
lein cloverage
# Open the coverage report ./target/coverage/index.html
open ./target/coverage/index.html # MacOS
xdg-open ./target/coverage/index.html # Linux
./e2e-test.sh || rm -rf /tmp/pre-commit-jira-test
The same as for testing + need to set up dev pre-commit hooks:
pre-commit install --install-hooks
-
(Optional) Edit the commit-msg.txt whatever you want
-
Run the hook:
pre-commit try-repo . add-jira-ticket --verbose --all-files \ --commit-msg-filename ./commit-msg.txt \ --hook-stage commit-msg
lein clj-kondo
lein zprint src/**/*.clj test/**/*.clj project.clj