Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/claudioaltamura/java-husky-commitizen-maven-spotless-example
Java example with Husky, Commitizen and Maven Spotless
https://github.com/claudioaltamura/java-husky-commitizen-maven-spotless-example
commitizen husky java maven spotless
Last synced: 9 days ago
JSON representation
Java example with Husky, Commitizen and Maven Spotless
- Host: GitHub
- URL: https://github.com/claudioaltamura/java-husky-commitizen-maven-spotless-example
- Owner: claudioaltamura
- License: mit
- Created: 2023-03-29T09:37:26.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-05-31T14:37:08.000Z (6 months ago)
- Last Synced: 2024-05-31T16:26:00.353Z (6 months ago)
- Topics: commitizen, husky, java, maven, spotless
- Language: Java
- Homepage:
- Size: 146 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![GitHub Workflow Status (with branch)](https://img.shields.io/github/actions/workflow/status/claudioaltamura/java-husky-commitizen-maven-spotless-example/maven-build.yaml?branch=main)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)# java-husky-commitizen-maven-spotless-example
java-husky-commitizen-maven-spotless-example## Husky
### Install
npm install husky --save-dev
### Configure
Add a hook
npx husky add .husky/pre-commit "mvn spotless:check"
## commitlint
### Install commitlint
npm install --save-dev @commitlint/{cli,config-conventional,prompt-cli}
### Configure
echo "module.exports = {extends: ['@commitlint/config-conventional']};" > commitlint.config.js
### Add another hook
npx husky add .husky/commit-msg 'npx --no -- commitlint --edit ${1}'
### Test hook commit-msg
see https://typicode.github.io/husky/guide.html#test-hooks
git commit -m "new: initial commit"
⧗ input: new: initial commit
✖ type must be one of [build, chore, ci, docs, feat, fix, perf, refactor, revert, style, test] [type-enum]✖ found 1 problems, 0 warnings
ⓘ Get help: https://github.com/conventional-changelog/commitlint/#what-is-commitlinthusky - commit-msg hook exited with code 1 (error)
see https://github.com/conventional-changelog/commitlint/#what-is-commitlint
### Bypass a commit
git commit -m "yolo!" --no-verify
## Commitizen
### Install
npm install -g commitizen
### Configure
commitizen init cz-conventional-changelog --save-dev --save-exact
### Use
git cz
### Override
git commit -m "override cz" --no-verify
## Links
https://typicode.github.io/husky/#/?id=install
https://commitlint.js.org/#/guides-local-setup
http://commitizen.github.io/cz-cli/