Skip to content

Commit

Permalink
feat: use solhint features (#82)
Browse files Browse the repository at this point in the history
Co-authored-by: Gas One Cent <[email protected]>
  • Loading branch information
0xShaito and gas1cent authored Oct 16, 2024
1 parent 537aac8 commit 20be385
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 38 deletions.
10 changes: 3 additions & 7 deletions .solhint.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
{
"extends": "solhint:recommended",
"rules": {
"compiler-version": ["off"],
"constructor-syntax": "warn",
"quotes": ["error", "single"],
"compiler-version": ["warn"],
"quotes": "off",
"func-visibility": ["warn", { "ignoreConstructors": true }],
"not-rely-on-time": "off",
"no-inline-assembly": "off",
"no-empty-blocks": "off",
"private-vars-leading-underscore": ["warn", { "strict": false }],
"ordering": "warn",
"immutable-name-snakecase": "warn",
"avoid-low-level-calls": "off",
"no-console": "off",
"max-line-length": ["warn", 120]
"named-parameters-mapping": "warn"
}
}
25 changes: 0 additions & 25 deletions .solhint.tests.json

This file was deleted.

10 changes: 4 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@
"coverage": "forge coverage --report summary --report lcov --match-path 'test/unit/*'",
"deploy:mainnet": "bash -c 'source .env && forge script Deploy --rpc-url $MAINNET_RPC --account $MAINNET_DEPLOYER_NAME --broadcast --verify --chain mainnet -vvvvv'",
"deploy:sepolia": "bash -c 'source .env && forge script Deploy --rpc-url $SEPOLIA_RPC --account $SEPOLIA_DEPLOYER_NAME --broadcast --verify --chain sepolia -vvvvv'",
"lint:check": "yarn lint:sol-tests && yarn lint:sol-logic && forge fmt --check",
"lint:fix": "sort-package-json && forge fmt && yarn lint:sol-tests --fix && yarn lint:sol-logic --fix",
"lint:check": "yarn lint:sol && forge fmt --check",
"lint:fix": "sort-package-json && forge fmt && yarn lint:sol --fix",
"lint:natspec": "npx @defi-wonderland/natspec-smells --config natspec-smells.config.js",
"lint:sol-logic": "solhint -c .solhint.json 'src/**/*.sol' 'script/**/*.sol'",
"lint:sol-tests": "solhint -c .solhint.tests.json 'test/**/*.sol'",
"lint:sol": "solhint 'src/**/*.sol' 'script/**/*.sol' 'test/**/*.sol'",
"prepare": "husky",
"test": "forge test -vvv",
"test:fuzz": "echidna test/invariants/fuzz/Greeter.t.sol --contract InvariantGreeter --corpus-dir test/invariants/fuzz/echidna_coverage/ --test-mode assertion",
Expand All @@ -30,8 +29,7 @@
},
"lint-staged": {
"*.{js,css,md,ts,sol}": "forge fmt",
"(src|script)/**/*.sol": "yarn lint:sol-logic",
"test/**/*.sol": "yarn lint:sol-tests",
"(src|test|script)/**/*.sol": "yarn lint:sol",
"package.json": "sort-package-json"
},
"devDependencies": {
Expand Down
7 changes: 7 additions & 0 deletions script/.solhint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"rules": {
"ordering": "off",
"one-contract-per-file": "off",
"no-console": "off"
}
}
11 changes: 11 additions & 0 deletions src/interfaces/.solhint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"rules": {
"ordering": "warn",
"style-guide-casing": [
"warn",
{
"ignoreExternalFunctions": true
}
]
}
}
16 changes: 16 additions & 0 deletions test/.solhint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"rules": {
"style-guide-casing": [
"warn",
{
"ignorePublicFunctions":true,
"ignoreExternalFunctions":true,
"ignoreContracts":true
}
],
"no-global-import": "off",
"max-states-count": "off",
"ordering": "off",
"one-contract-per-file": "off"
}
}

0 comments on commit 20be385

Please sign in to comment.