Skip to content

Commit d09c219

Browse files
committed
ci: adds circuit lint
1 parent 7b48d84 commit d09c219

File tree

4 files changed

+31
-18
lines changed

4 files changed

+31
-18
lines changed

.github/workflows/ci.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,30 @@ jobs:
7171
- name: Run Solhint
7272
run: yarn solidity:lint
7373

74+
circuit-lint:
75+
name: Circuit Lint
76+
runs-on: ubuntu-latest
77+
steps:
78+
- name: Checkout code
79+
uses: actions/checkout@v4
80+
81+
- name: Setup Node.js
82+
uses: actions/setup-node@v4
83+
with:
84+
node-version: '20'
85+
cache: 'yarn'
86+
87+
- name: Install dependencies
88+
run: yarn install --frozen-lockfile
89+
90+
- name: Install Noir
91+
uses: noir-lang/[email protected]
92+
with:
93+
toolchain: '1.0.0-beta.6'
94+
95+
- name: Run Nargo Format
96+
run: yarn circuit:lint
97+
7498
format-check:
7599
name: Format Check
76100
runs-on: ubuntu-latest

.lintstagedrc.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
'*.{js,mjs,ts,tsx}': ['npx eslint --fix', 'prettier --write'],
3+
'*.nr': () => 'cd circuit && nargo fmt',
4+
'*.sol': ['npx hardhat check --fix', 'prettier --write'],
5+
'*.{json,md,yml,yaml}': ['prettier --write'],
6+
};

circuit/src/main.nr

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,5 @@ fn main(x: Field, y: pub Field, z: pub Field) {
44

55
#[test]
66
fn test_main() {
7-
main(1,
8-
2, 1);
7+
main(1, 2, 1);
98
}

package.json

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -61,21 +61,5 @@
6161
"format:check": "prettier --check .",
6262
"all:lint": "yarn typescript:lint && yarn solidity:lint && yarn circuit:lint && yarn format:check"
6363
},
64-
"lint-staged": {
65-
"*.{js,mjs,ts,tsx}": [
66-
"eslint --fix",
67-
"prettier --write"
68-
],
69-
"*.nr": [
70-
"cd circuit && nargo fmt"
71-
],
72-
"*.sol": [
73-
"npx hardhat check --fix",
74-
"prettier --write"
75-
],
76-
"*.{json,md,yml,yaml}": [
77-
"prettier --write"
78-
]
79-
},
8064
"packageManager": "[email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
8165
}

0 commit comments

Comments
 (0)