Skip to content

Commit

Permalink
feat: use solhint features
Browse files Browse the repository at this point in the history
  • Loading branch information
0xShaito committed Sep 4, 2024
1 parent 5fd9a75 commit cab3887
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 39 deletions.
11 changes: 3 additions & 8 deletions .solhint.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
{
"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]
"avoid-low-level-calls": "off"
}
}
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 -vvvvv --rpc-url $MAINNET_RPC --broadcast --chain mainnet --private-key $MAINNET_DEPLOYER_PK'",
"deploy:sepolia": "bash -c 'source .env && forge script Deploy -vvvvv --rpc-url $SEPOLIA_RPC --broadcast --chain sepolia --private-key $SEPOLIA_DEPLOYER_PK'",
"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 install",
"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": "off",
"style-guide-casing": [
"warn",
{
"ignoreExternalFunctions": true
}
]
}
}
9 changes: 9 additions & 0 deletions test/.solhint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"rules": {
"style-guide-casing": "off",
"no-global-import": "off",
"max-states-count": "off",
"ordering": "off",
"one-contract-per-file": "off"
}
}

0 comments on commit cab3887

Please sign in to comment.