Skip to content

Commit

Permalink
ci: adding husky and commitlint
Browse files Browse the repository at this point in the history
see .gitignore

ci: removing git add

ci: using lint-staged since it only works staged files

ci: adding a pre-commit with npx lint-staged

ci: improve flow with husky and commitlint

ci(ci-improve): 👷 testing the working of commitlint

commitlint checks with husky

invalid commit message

test

test
  • Loading branch information
poppyseedDev committed Oct 14, 2024
1 parent 76275f9 commit 7bc845b
Show file tree
Hide file tree
Showing 7 changed files with 1,158 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ yarn-error.log*
lerna-debug.log*
pnpm-lock.yaml
yarn.lock
.vscode

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
Expand Down
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

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

npx lint-staged
3 changes: 3 additions & 0 deletions .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"*.{js,json,md,sol,ts,yml}": ["npm run prettier -- --write"]
}
6 changes: 6 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
extends: ["@commitlint/config-conventional"],
rules: {
"type-enum": [2, "always", ["ci", "chore", "docs", "ticket", "feat", "fix", "perf", "refactor", "revert", "style"]],
},
};
Loading

0 comments on commit 7bc845b

Please sign in to comment.