Skip to content

Commit

Permalink
build: install & configure prettier and solhint
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielstoica committed Nov 7, 2024
1 parent 8b1dfa4 commit a256e78
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 4 deletions.
19 changes: 19 additions & 0 deletions .solhint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"extends": "solhint:recommended",
"rules": {
"avoid-low-level-calls": "off",
"code-complexity": ["error", 9],
"compiler-version": ["error", ">=0.8.22"],
"contract-name-camelcase": "off",
"const-name-snakecase": "off",
"func-name-mixedcase": "off",
"func-visibility": ["error", { "ignoreConstructors": true }],
"gas-custom-errors": "off",
"max-line-length": ["error", 124],
"named-parameters-mapping": "warn",
"no-empty-blocks": "off",
"not-rely-on-time": "off",
"one-contract-per-file": "off",
"var-name-mixedcase": "off"
}
}
2 changes: 0 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{
"solidity.packageDefaultDependenciesContractsDirectory": "src",
"solidity.packageDefaultDependenciesDirectory": "lib",
"editor.formatOnSave": true,
"[solidity]": {
"editor.defaultFormatter": "NomicFoundation.hardhat-solidity"
Expand Down
Binary file modified bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ runs = 10_000
bracket_spacing = true
int_types = "long"
line_length = 120
multiline_func_header = "params_first"
multiline_func_header = "all"
number_underscore = "thousands"
quote_style = "double"
tab_width = 4
Expand Down
12 changes: 11 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
{
"scripts": {
"build": "forge build",
"lint": "bun run lint:sol && bun run prettier:check",
"lint:sol": "forge fmt --check && bun solhint \"{precompiles,script,src,test}/**/*.sol\"",
"prettier:check": "prettier --check --plugin=prettier-plugin-solidity \"**/*.{json,md,svg,yml}\"",
"prettier:write": "prettier --write --plugin=prettier-plugin-solidity \"**/*.{json,md,svg,yml,sol}\""
},
"devDependencies": {
"forge-std": "github:foundry-rs/forge-std#v1.9.4"
"forge-std": "github:foundry-rs/forge-std#v1.9.4",
"prettier": "^3.3.3",
"prettier-plugin-solidity": "^1.4.1",
"solhint": "^5.0.3"
},
"dependencies": {
"@openzeppelin/contracts": "^5.1.0",
Expand Down

0 comments on commit a256e78

Please sign in to comment.