Skip to content

Commit 652c805

Browse files
added husky and configured it for required workflow (#162)
Signed-off-by: NeelParihar <neel@terminusdb.com>
1 parent 9e7fff4 commit 652c805

File tree

5 files changed

+44
-1
lines changed

5 files changed

+44
-1
lines changed

.husky/pre-commit

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
# Lint
5+
npm run lint:check;
6+
7+
# Test
8+
npm test;
9+
10+
# Build
11+
npm run build
12+
13+
# Check changes in docs
14+
npm run mkdocs;
15+
git diff --exit-code

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,8 @@ If you encounter other questions, you can ask in our [Discord Server](https://di
166166

167167
## Contribute
168168

169+
> :memo: This project uses [Husky](https://www.npmjs.com/package/husky) which automatically runs lint, tests, and other scripts when you try to commit any changes to the repository. This helps us to improve each commit done to the repo and is automatically installed and configured when you do `npm install`
170+
169171
It will be nice, if you open an issue first so that we can know what is going on, then, fork this repo and push in your ideas. Do not forget to add a bit of test(s) of what value you adding.
170172

171173
Please check [Contributing.md](Contributing.md) for more information.

docs/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,8 @@ If you encounter other questions, you can ask in our [Discord Server](https://di
166166

167167
## Contribute
168168

169+
> :memo: This project uses [Husky](https://www.npmjs.com/package/husky) which automatically runs lint, tests, and other scripts when you try to commit any changes to the repository. This helps us to improve each commit done to the repo and is automatically installed and configured when you do `npm install`
170+
169171
It will be nice, if you open an issue first so that we can know what is going on, then, fork this repo and push in your ideas. Do not forget to add a bit of test(s) of what value you adding.
170172

171173
Please check [Contributing.md](Contributing.md) for more information.

package-lock.json

Lines changed: 22 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
"eslint-plugin-import": "^2.25.4",
4949
"eslint-plugin-prettier": "3.1.3",
5050
"html-webpack-plugin": "^5.3.1",
51+
"husky": "^7.0.4",
5152
"jsdoc-to-markdown": "^7.1.0",
5253
"mocha": "^9.1.3",
5354
"nyc": "^15.1.0",
@@ -76,7 +77,8 @@
7677
"npm:publish": "npm publish --access public",
7778
"test-single": "mocha $1",
7879
"woql-test": "mocha test/woqlTripleBuilder.spec.js test/woql.spec.js test/woqlTripleBuilder01.spec.js test/woqlExtra.spec.js",
79-
"git-tag": "git tag $npm_package_version"
80+
"git-tag": "git tag $npm_package_version",
81+
"prepare": "husky install"
8082
},
8183
"repository": {
8284
"type": "git",

0 commit comments

Comments
 (0)