Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,30 @@ jobs:
- name: Run Solhint
run: yarn solidity:lint

circuit-lint:
name: Circuit Lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'yarn'

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Install Noir
uses: noir-lang/[email protected]
with:
toolchain: '1.0.0-beta.6'

- name: Run Nargo Format
run: yarn circuit:lint

format-check:
name: Format Check
runs-on: ubuntu-latest
Expand Down
6 changes: 6 additions & 0 deletions .lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
'*.{js,mjs,ts,tsx}': ['npx eslint --fix', 'prettier --write'],
'*.nr': () => 'cd circuit && nargo fmt',
'*.sol': ['npx hardhat check --fix', 'prettier --write'],
'*.{json,md,yml,yaml}': ['prettier --write'],
};
16 changes: 3 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
},
"scripts": {
"vars:list": "npx hardhat vars list",
"circuit:lint": "cd circuit && nargo fmt --check",
"circuit:lint:fix": "cd circuit && nargo fmt",
"circuit:build": "cd circuit && nargo build",
"circuit:witness": "cd circuit && nargo execute witness",
"circuit:vk": "cd circuit && bb write_vk -b ./target/num_diff.json -o ./target --oracle_hash keccak",
Expand All @@ -57,19 +59,7 @@
"solidity:lint:fix": "npx hardhat check --fix",
"format": "prettier --write .",
"format:check": "prettier --check .",
"lint:all": "yarn typescript:lint && yarn solidity:lint && yarn format:check"
},
"lint-staged": {
"*.{js,mjs,ts,tsx}": [
"eslint --fix",
"prettier --write"
],
"*.sol": [
"prettier --write"
],
"*.{json,md,yml,yaml}": [
"prettier --write"
]
"all:lint": "yarn typescript:lint && yarn solidity:lint && yarn circuit:lint && yarn format:check"
},
"packageManager": "[email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}
Loading