Skip to content

Commit

Permalink
fix: detect compiler warnings in CI (#235)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamegyed authored Oct 9, 2024
1 parent 8b79d51 commit 01d5b9f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,19 @@ fail_on_revert = true
depth = 10

[profile.optimized-build]
deny_warnings = true
via_ir = true
test = 'src'
optimizer_runs = 10000
out = 'out-optimized'
cache_path = 'cache-optimized'

[profile.optimized-test]
deny_warnings = true
src = 'test'

[profile.optimized-test-deep]
deny_warnings = true
src = 'test'

[profile.optimized-test-deep.fuzz]
Expand All @@ -54,6 +57,7 @@ depth = 32

[profile.gas]
via_ir = true
deny_warnings = true
test = 'gas'
optimizer_runs = 10000
out = 'out-optimized'
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"lint:test": "solhint --max-warnings 0 -c ./config/solhint-test.json './test/**/*.sol'",
"lint:gas": "solhint --max-warnings 0 -c ./config/solhint-gas.json './gas/**/*.sol'",
"lint:script": "solhint --max-warnings 0 -c ./config/solhint-script.json './script/**/*.sol'",
"prep": "pnpm fmt && forge b && pnpm lint && pnpm test && pnpm gas",
"prep": "pnpm fmt && forge b --deny-warnings && pnpm lint && pnpm test && pnpm gas",
"test": "forge test"
}
}
2 changes: 1 addition & 1 deletion test/modules/AllowlistModule.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ contract AllowlistModuleTest is CustomValidationTestBase {
/// - case 1 - a selector (Counter.setNumber) + address (counters[0]) should match
/// - case 2 - wildcard selector (Counter.increment), any address works
/// - case 3 - wildcard address (counters[1]), any selector works
function _getInputsForTests() internal returns (AllowlistModule.AllowlistInput[] memory) {
function _getInputsForTests() internal view returns (AllowlistModule.AllowlistInput[] memory) {
AllowlistModule.AllowlistInput[] memory inputs = new AllowlistModule.AllowlistInput[](3);
// case 1 - a selector (Counter.setNumber) + address (counters[0]) should match
bytes4[] memory selectors1 = new bytes4[](1);
Expand Down

2 comments on commit 01d5b9f

@duangmuangprom1
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@duangmuangprom1
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


Please sign in to comment.