warning | layout | title |
---|---|---|
This is a dynamically generated file. Do not edit manually. |
default |
foundry-test-functions | Solhint |
Enforce naming convention on functions for Foundry test cases
This rule accepts an array of options:
Index | Description | Default Value |
---|---|---|
0 | Rule severity. Must be one of "error", "warn", "off". | warn |
{
"rules": {
"foundry-test-functions": ["warn",["setUp"]]
}
}
- This rule can be configured to skip certain function names in the SKIP array. In Example Config.
setUp
function will be skipped - Supported Regex:
test(Fork)?(Fuzz)?(Fail)?_(Revert(If_|When_){1})?\w{1,}
- This rule should be executed in a separate folder with a separate .solhint.json =>
solhint --config .solhint.json testFolder/**/*.sol
- This rule applies only to
external
andpublic
functions - This rule skips the
setUp()
function by default
function test_NumberIs42() public {}
function testFail_Subtract43() public {}
function testFuzz_FuzzyTest() public {}
function numberIs42() public {}
This rule was introduced in Solhint 3.6.1