Skip to content

Commit

Permalink
docs(rework documentation): reformatted, reordered
Browse files Browse the repository at this point in the history
  • Loading branch information
claudioaltamura committed Oct 2, 2023
1 parent 73799da commit 3c51907
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx --no -- commitlint --edit ${1}
npx --no -- commitlint --edit ${1}
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

mvn test
mvn spotless:check
27 changes: 16 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,17 @@
# java-husky-commitizen-maven-spotless-example
java-husky-commitizen-maven-spotless-example

spotless not working!!!

## Husky

### Install

npm install husky --save-dev

### Configure

Add a hook

npx husky add .husky/commit-msg 'npx --no -- commitlint --edit "$1"'

npx husky add .husky/pre-commit "mvn test"
npx husky add .husky/pre-commit "mvn spotless:check"

## commitlint

Expand All @@ -29,13 +25,15 @@ Add a hook

### Configure

echo "module.exports = {extends: ['@commitlint/config-conventional']};" > commitlint.config.js
echo "module.exports = {extends: ['@commitlint/config-conventional']};" > commitlint.config.js

### Add another hook

### Add hook

npx husky add .husky/commit-msg 'npx --no -- commitlint --edit ${1}'

### Test
### Test hook commit-msg

see https://typicode.github.io/husky/guide.html#test-hooks

git commit -m "new: initial commit"

Expand All @@ -47,10 +45,17 @@ Add a hook

husky - 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
Expand Down

0 comments on commit 3c51907

Please sign in to comment.