diff --git a/.githooks/pre-push b/.githooks/pre-push new file mode 100755 index 000000000..a51f3884a --- /dev/null +++ b/.githooks/pre-push @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +set -euo pipefail + +if [ "${CI:-"false"}" != "true" ]; then + npm run lint +fi diff --git a/package.json b/package.json index 80c41b49c..cc5d8a774 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "coverage": "env COVERAGE=true hardhat coverage", "docs": "npm run prepare-docs && oz-docs", "docs:watch": "oz-docs watch contracts docs/templates docs/config.js", + "prepare": "git config --local core.hooksPath .githooks", "prepare-docs": "scripts/prepare-docs.sh", "lint": "npm run lint:js && npm run lint:sol", "lint:fix": "npm run lint:js:fix && npm run lint:sol:fix",