diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1d8af81e..04396e96 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -26,8 +26,12 @@ jobs: cache: 'npm' # Cache dependencies - name: Install dependencies run: npm ci + - name: Check code formatting + run: npm run check-format - name: Build run: npm run build + - name: Check documentation is up-to-date + run: npm run check-doc - name: Check storage layout run: npm run check-storage-layout - name: Test deployment diff --git a/.husky/pre-commit b/.husky/pre-commit index 60adb205..2312dc58 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,6 +1 @@ npx lint-staged - -# Update Solidity documentation only if .sol files were changed. -if git diff --cached --name-only | grep -E '\.sol$' > /dev/null; then - npm run doc -fi diff --git a/package-lock.json b/package-lock.json index 5585fdf6..b0d683ae 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,7 +25,6 @@ "@openzeppelin/upgrades-core": "^1.37.1", "dotenv": "^16.5.0", "hardhat": "^2.26.5", - "hardhat": "^2.22.18", "hardhat-abi-exporter": "^2.11.0", "hardhat-dependency-compiler": "^1.2.1", "hardhat-deploy": "^0.11.43", diff --git a/package.json b/package.json index fbfd7132..eb3e9e37 100644 --- a/package.json +++ b/package.json @@ -19,11 +19,13 @@ "verify": "npx hardhat verify", "verify:all": "npx hardhat run scripts/verify.ts", "format": "npx prettier --write .", + "check-format": "npx prettier --check .", "uml": "npm run sol-to-uml && npm run puml-to-links && npm run storage-to-diagrams", "sol-to-uml": "npx zx scripts/tools/sol-to-uml.mjs", "puml-to-links": "npx zx scripts/tools/puml-to-links.mjs", "storage-to-diagrams": "bash scripts/tools/storage-to-diagrams.sh", "doc": "npx hardhat docgen", + "check-doc": "npm run doc && git diff --exit-code docs/", "prerelease": "npm version prerelease --preid=rc -m 'chore: v%s'" }, "files": [