Skip to content

Commit 66d5436

Browse files
authored
chore: setup commitlint (#37)
1 parent fe14877 commit 66d5436

File tree

5 files changed

+700
-0
lines changed

5 files changed

+700
-0
lines changed

.github/workflows/ci-default.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ jobs:
5252
- recursive: true
5353
args: [--frozen-lockfile, --strict-peer-dependencies]
5454
55+
- name: Validate PR commits with commitlint
56+
if: github.event_name == 'pull_request'
57+
run: pnpm commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose
58+
5559
- name: Setup Python
5660
uses: actions/setup-python@v5
5761
with:

.husky/commit-msg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
pnpm commitlint --edit ${1}

commitlint.config.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import type { UserConfig } from "@commitlint/types";
2+
3+
const config: UserConfig = {
4+
extends: ["@commitlint/config-conventional"]
5+
};
6+
7+
export default config;

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
"prepare": "husky install"
1717
},
1818
"devDependencies": {
19+
"@commitlint/types": "^19.8.0",
20+
"@commitlint/cli": "^19.8.0",
21+
"@commitlint/config-conventional": "^19.8.0",
1922
"eslint": "^8.57.0",
2023
"husky": "^8.0.3",
2124
"lint-staged": "^15.2.7",

0 commit comments

Comments
 (0)