Skip to content

Commit 8b67e83

Browse files
committed
fix: pre-commit lint on only staged, and add yarn test:coverage:file
1 parent ea650f2 commit 8b67e83

File tree

3 files changed

+30
-4
lines changed

3 files changed

+30
-4
lines changed

packages/contracts/package.json

+6-4
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@
9090
"test:e2e": "scripts/e2e",
9191
"test:gas": "RUN_EVM=true REPORT_GAS=true scripts/test",
9292
"test:coverage": "scripts/coverage",
93+
"test:coverage:file": "scripts/test-coverage-file",
9394
"test:upgrade": "scripts/upgrade",
9495
"lint": "yarn lint:ts && yarn lint:sol",
9596
"lint:ts": "eslint '**/*.{js,ts}' --fix",
@@ -103,16 +104,17 @@
103104
},
104105
"lint-staged": {
105106
"contracts/**/*.sol": [
106-
"yarn lint:sol"
107+
"prettier --write",
108+
"solhint --fix --noPrompt --config node_modules/solhint-graph-config/index.js"
107109
],
108110
"**/*.ts": [
109-
"yarn lint:ts"
111+
"eslint --fix"
110112
],
111113
"**/*.js": [
112-
"yarn lint:ts"
114+
"eslint --fix"
113115
],
114116
"**/*.json": [
115-
"yarn lint:ts"
117+
"eslint --fix"
116118
]
117119
},
118120
"repository": {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/bin/env bash
2+
3+
set -eo pipefail
4+
5+
# Check if a test file was provided
6+
if [ $# -eq 0 ]; then
7+
echo "Error: You must provide a test file path"
8+
echo "Usage: ./scripts/test-coverage-file test/unit/rewards/rewards.test.ts"
9+
exit 1
10+
fi
11+
12+
# Build contracts first to ensure tests run against latest code
13+
echo "Building contracts before running coverage..."
14+
yarn build
15+
16+
echo {} > addresses-local.json
17+
18+
echo "Running coverage for test file: $1"
19+
DISABLE_SECURE_ACCOUNTS=true \
20+
L1_GRAPH_CONFIG=config/graph.hardhat.yml \
21+
L2_GRAPH_CONFIG=config/graph.arbitrum-hardhat.yml \
22+
ADDRESS_BOOK=addresses-local.json \
23+
npx hardhat coverage --testfiles "$1"

packages/issuance/lib/forge-std

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit 77041d2ce690e692d6e03cc812b57d1ddaa4d505

0 commit comments

Comments
 (0)