forked from Layr-Labs/eigenlayer-contracts
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: require solhint as part of continuous integration
- Loading branch information
1 parent
bb5ae18
commit 0e59845
Showing
15 changed files
with
1,435 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,33 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
NVM_DIR=${HOME}/.nvm | ||
NODE_VERSION=v22.3.0 | ||
|
||
# Install node | ||
function npm_install { | ||
mkdir -p ${NVM_DIR}/etc | ||
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash | ||
bash -c ". ${NVM_DIR}/nvm.sh && nvm install ${NODE_VERSION} && nvm alias default ${NODE_VERSION} && nvm use default" | ||
|
||
NVM_NODE_PATH=${NVM_DIR}/versions/node/${NODE_VERSION} | ||
NODE_PATH=${NVM_NODE_PATH}/lib/node_modules | ||
PATH=${NVM_NODE_PATH}/bin:$PATH | ||
|
||
npm install npm -g | ||
npm install yarn -g | ||
} | ||
|
||
# Install foundry | ||
curl -L https://foundry.paradigm.xyz | bash | ||
~/.foundry/bin/foundryup | ||
function foundry_install { | ||
curl -L https://foundry.paradigm.xyz | bash | ||
~/.foundry/bin/foundryup | ||
} | ||
|
||
npm_install | ||
foundry_install | ||
|
||
export NVM_NODE_PATH=${NVM_DIR}/versions/node/${NODE_VERSION} | ||
export NODE_PATH=${NVM_NODE_PATH}/lib/node_modules | ||
export PATH=${PATH}:${NVM_NODE_PATH}/bin: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,29 @@ | ||
name: format | ||
|
||
name: lint and check format | ||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
push: | ||
branches: | ||
- "dev" | ||
|
||
jobs: | ||
check: | ||
strategy: | ||
fail-fast: true | ||
|
||
name: Foundry project | ||
name: Foundry Fmt | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Install Foundry | ||
uses: foundry-rs/foundry-toolchain@v1 | ||
with: | ||
version: nightly | ||
|
||
- name: Run Forge linter | ||
- name: Run forge fmt | ||
run: | | ||
forge fmt src/contracts --check | ||
id: lint | ||
forge fmt --check src/contracts | ||
id: fmt | ||
- name: install npm dependencies | ||
run: npm install --include=dev | ||
- name: run solhint | ||
run: npm run hint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
{ | ||
// See https://go.microsoft.com/fwlink/?LinkId=733558 | ||
// for the documentation about the tasks.json format | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"label": "install", | ||
"type": "shell", | ||
"command": "npm install --include=dev", | ||
"options": { | ||
"cwd": "${workspaceFolder}", | ||
}, | ||
"group": { | ||
"kind": "build" | ||
} | ||
}, | ||
{ | ||
"label": "fmt", | ||
"type": "shell", | ||
"command": "forge fmt --check src/contracts", | ||
"options": { | ||
"cwd": "${workspaceFolder}" | ||
}, | ||
"dependsOn": "install", | ||
"group": { | ||
"kind": "build" | ||
} | ||
}, | ||
{ | ||
"label": "hint", | ||
"type": "shell", | ||
"command": "npm run hint", | ||
"options": { | ||
"cwd": "${workspaceFolder}" | ||
}, | ||
"dependsOn": "fmt", | ||
"group": { | ||
"kind": "build" | ||
} | ||
}, | ||
{ | ||
"label": "build", | ||
"type": "shell", | ||
"command": "forge build --sizes", | ||
"options": { | ||
"cwd": "${workspaceFolder}" | ||
}, | ||
"dependsOn": "hint", | ||
"group": { | ||
"kind": "build", | ||
"isDefault": true | ||
} | ||
}, | ||
{ | ||
"label": "clean", | ||
"type": "shell", | ||
"command": "forge clean && forge cache clean", | ||
"options": { | ||
"cwd": "${workspaceFolder}" | ||
}, | ||
"dependsOn": "build", | ||
"group": { | ||
"kind": "build", | ||
"isDefault": false | ||
} | ||
}, | ||
{ | ||
"label": "test", | ||
"type": "shell", | ||
"command": "forge test -vvv", | ||
"options": { | ||
"cwd": "${workspaceFolder}" | ||
}, | ||
"dependsOn": "hint", | ||
"group": { | ||
"kind": "test", | ||
"isDefault": true | ||
} | ||
}, | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.