Skip to content

Commit

Permalink
chore: implements conventional commit checking
Browse files Browse the repository at this point in the history
Installs commitizen, commitlint and lefthook
  • Loading branch information
Genyus committed Apr 26, 2023
1 parent 0802b2b commit 224b99a
Show file tree
Hide file tree
Showing 6 changed files with 7,789 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ indent_style = space
indent_size = 2
indent_style = space

[*.json]
indent_size = 2
indent_style = space

[*.md]
trim_trailing_whitespace = false

Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,6 @@ Thumbs.db

# PHPCS
.phpcs.cache

#NPM
node_modules
1 change: 1 addition & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = { extends: ["@commitlint/config-conventional"] };
24 changes: 24 additions & 0 deletions lefthook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Refer to following link for explanation:
# https://github.com/evilmartians/lefthook/blob/master/docs/configuration.md

# Use this to build commit messages
prepare-commit-msg:
commands:
commitizen:
interactive: true
run: "LEFTHOOK=0;sh -c ': >/dev/tty' > /dev/null 2>&1; if sh -c ': >/dev/tty' >/dev/null 2>/dev/null; then ( exec < /dev/tty && npx cz ) || true 2> /dev/null; fi"
# run: LEFTHOOK=0 && npx cz

# Use this to validate commit messages
commit-msg:
commands:
"lint commit message":
run: npm run commitlint --edit ${1}


# pre-commit:
# parallel: true
# commands:
# eslint:
# glob: "*.js"
# run: npm lint -- --fix {staged_files} && git add {staged_files}
Loading

0 comments on commit 224b99a

Please sign in to comment.