Skip to content

Commit

Permalink
chore: add solhint
Browse files Browse the repository at this point in the history
  • Loading branch information
madlabman committed Oct 16, 2023
1 parent 6fe09e2 commit e9de6df
Show file tree
Hide file tree
Showing 4 changed files with 1,158 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ jobs:
actions:
uses: lidofinance/linters/.github/workflows/actions.yml@master

prettier:
name: Prettier
linters:
name: Linters
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down
18 changes: 18 additions & 0 deletions .solhint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"extends": "solhint:recommended",
"plugins": ["lido-csm"],
"rules": {
"no-inline-assembly": "off",
"no-unused-import": "error",
"func-named-parameters": "error",
"func-visibility": ["error", { "ignoreConstructors": true }],
"reason-string": ["warn", { "maxLength": 64 }],
"immutable-vars-naming": ["warn", { "immutablesAsConstants": true }],
"lido-csm/vars-with-underscore": "error",
"lido-csm/enum-name-camelcase": "error",
"lido-csm/struct-name-camelcase": "error",
"lido-csm/interface-member-order": "error",
"lido-csm/interface-starts-with-i": "error",
"lido-csm/contract-ordering": "error"
}
}
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,21 @@
"license": "GPL-3.0",
"private": true,
"scripts": {
"lint:check": "prettier --check **.sol",
"lint:solhint": "solhint './src/**/*.sol'",
"lint:check": "prettier --check **.sol && yarn lint:solhint",
"lint:fix": "prettier --write **.sol",
"postinstall": "husky install"
},
"devDependencies": {
"husky": "^8.0.3",
"lint-staged": "^14.0.1",
"prettier": "^3.0.3",
"prettier-plugin-solidity": "^1.1.3"
"prettier-plugin-solidity": "^1.1.3",
"solhint": "^3.6.2",
"solhint-plugin-lido-csm": "https://github.com/lidofinance/solhint-plugin-lido-csm.git#feat/lido-csm-rules"
},
"lint-staged": {
"*": "prettier --ignore-unknown --write"
"*": "prettier --ignore-unknown --write",
"*.sol": "solhint"
}
}
Loading

0 comments on commit e9de6df

Please sign in to comment.