Bladeren bron

Run linter before pushing to git (#4962)

Co-authored-by: Ernesto García <ernestognw@gmail.com>
Hadrien Croubois 1 jaar geleden
bovenliggende
commit
976a3d5362
2 gewijzigde bestanden met toevoegingen van 8 en 0 verwijderingen
  1. 7 0
      .githooks/pre-push
  2. 1 0
      package.json

+ 7 - 0
.githooks/pre-push

@@ -0,0 +1,7 @@
+#!/usr/bin/env bash
+
+set -euo pipefail
+
+if [ "${CI:-"false"}" != "true" ]; then
+  npm run lint
+fi

+ 1 - 0
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",