Skip to content

Commit

Permalink
fix: update prepare-hook to install commitlint conventional config an…
Browse files Browse the repository at this point in the history
…d add commitlint.config.js
  • Loading branch information
shashank.p committed Mar 27, 2024
1 parent 600e411 commit c9787d1
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
27 changes: 27 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'type-enum': [
2, // Error if the type is not in the enum
'always', // Type is always required
[
'build',
'chore',
'ci',
'docs',
'feat',
'fix',
'perf',
'refactor',
'revert',
'style',
'test',
],
],
'scope-enum': [
2,
'always',
['database', /* Other possible scopes */]
],
},
};
2 changes: 1 addition & 1 deletion githooks/prepare-hook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ if ! command -v npm &> /dev/null; then
fi

if ! command -v commitlint &> /dev/null; then
npm install --global commitlint@latest
npm install --global commitlint@latest @commitlint/cli@latest @commitlint/config-conventional
fi

cd "$parent_dir" || exit
Expand Down

0 comments on commit c9787d1

Please sign in to comment.