diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 00000000..ba3ac63e --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,36 @@ +name: Lint + +on: + workflow_dispatch: + pull_request: + paths: + - '**.sol' + push: + branches: + - main + paths: + - '**.sol' + +env: + FOUNDRY_PROFILE: ci + +jobs: + lint: + strategy: + fail-fast: true + + name: Foundry project + 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: Check Forge fmt + run: forge fmt --check + id: format diff --git a/.vscode/settings.json b/.vscode/settings.json index bdb69ebf..20913ceb 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -3,4 +3,5 @@ "editor.defaultFormatter": "JuanBlanco.solidity" }, "solidity.compileUsingRemoteVersion": "v0.7.6+commit.7338295f", + "solidity.formatter": "forge" } diff --git a/foundry.toml b/foundry.toml index 39d90b86..7a628779 100644 --- a/foundry.toml +++ b/foundry.toml @@ -7,3 +7,10 @@ libs = ["node_modules", "lib"] via_ir = false optimizer = true optimizer_runs = 1000000 + +[fmt] +ignore = [ + # We don't want to change the formatting of our main contracts until the + # migration to Foundry is concluded. + "src/contracts/**/*" +] diff --git a/test/TestNoOp.sol b/test/TestNoOp.sol deleted file mode 100644 index 8299b21b..00000000 --- a/test/TestNoOp.sol +++ /dev/null @@ -1,7 +0,0 @@ -// SPDX-License-Identifier: LGPL-3.0-or-later -pragma solidity >=0.7.6 <0.9.0; - -/// @dev No-op contract for start of forgifying contracts. Delete this! -contract TestNoOp { - function test_noOp() external pure {} -}