Skip to content

Commit 46c964c

Browse files
committed
feat: pre-commit hook
1 parent 5e4e463 commit 46c964c

File tree

5 files changed

+30
-1
lines changed

5 files changed

+30
-1
lines changed

.github/workflows/docs.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ on:
99
permissions:
1010
contents: read
1111

12+
env:
13+
HUSKY: 0
14+
1215
jobs:
1316
markdown_tables:
1417
name: Check Markdown Tables

.github/workflows/test.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ on:
99
permissions:
1010
contents: read
1111

12+
env:
13+
HUSKY: 0
14+
1215
jobs:
1316
lint:
1417
name: Lint

.husky/pre-commit

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
npm run fix:tables
2+
npm run test:links
3+
npm run test:build
4+
git update-index --again

package-lock.json

+17
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
"test:build": "tsx tools/checkBuild.ts",
2929
"test:tables": "npx markdown-table-formatter \"docs/**/*.{md,mdx}\" --check",
3030
"fix:tables": "npx markdown-table-formatter \"docs/**/*.{md,mdx}\"",
31-
"decorate:docs": "node tools/doxygen/generate-social-sdk-mapping.js && node tools/doxygen/decorate-social-sdk-references.js"
31+
"decorate:docs": "node tools/doxygen/generate-social-sdk-mapping.js && node tools/doxygen/decorate-social-sdk-references.js",
32+
"prepare": "npx husky || true"
3233
},
3334
"devDependencies": {
3435
"@actions/core": "^1.10.1",
@@ -41,6 +42,7 @@
4142
"eslint": "^9.2.0",
4243
"eslint-config-prettier": "^9.1.0",
4344
"eslint-plugin-prettier": "^5.1.3",
45+
"husky": "9.1.7",
4446
"js-yaml": "^4.1.0",
4547
"markdown-table-formatter": "^1.6.0",
4648
"mdast-util-from-markdown": "^2.0.1",

0 commit comments

Comments
 (0)