From 20c1136dc89002a7a677bc283a0f67667cd66cb1 Mon Sep 17 00:00:00 2001 From: Aaron Steinfeld Date: Thu, 15 Jul 2021 17:57:53 -0400 Subject: [PATCH] chore: update husky config --- .husky/commit-msg | 4 ++++ .husky/pre-commit | 4 ++++ .husky/pre-push | 4 ++++ package.json | 12 +++--------- 4 files changed, 15 insertions(+), 9 deletions(-) create mode 100755 .husky/commit-msg create mode 100755 .husky/pre-commit create mode 100755 .husky/pre-push diff --git a/.husky/commit-msg b/.husky/commit-msg new file mode 100755 index 000000000..e8511eaea --- /dev/null +++ b/.husky/commit-msg @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +npx --no-install commitlint --edit $1 diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 000000000..f91359dc2 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +npx --no-install pretty-quick --staged diff --git a/.husky/pre-push b/.husky/pre-push new file mode 100755 index 000000000..a6d839a67 --- /dev/null +++ b/.husky/pre-push @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +npm run lint && npm run test diff --git a/package.json b/package.json index 1cc039923..e7296a55b 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,8 @@ "lint:fix": "ng lint --fix hypertrace-ui", "prettier:check": "prettier --check '**'", "test:ci": "ng test hypertrace-ui --maxWorkers=2 --ci --coverage", - "docs": "compodoc -p tsconfig.json" + "docs": "compodoc -p tsconfig.json", + "prepare": "husky install" }, "private": true, "dependencies": { @@ -95,7 +96,7 @@ "codelyzer": "^6.0.2", "commitizen": "^4.2.4", "cz-conventional-changelog": "^3.3.0", - "husky": "^7.0.1", + "husky": "^7.0.0", "jest": "^26.6.3", "jest-config": "^27.0.4", "jest-html-reporter": "^3.4.1", @@ -121,12 +122,5 @@ "extends": [ "@commitlint/config-conventional" ] - }, - "husky": { - "hooks": { - "pre-push": "npm run lint && npm run test", - "pre-commit": "pretty-quick --staged", - "commit-msg": "commitlint -E HUSKY_GIT_PARAMS" - } } }