You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-w, --max-warnings [maxWarningsNumber] number of allowed warnings, works in quiet mode as well
65
-
-c, --config [file_name] file to use as your .solhint.json
65
+
-c, --config [file_name] file to use as your rules configuration file (not compatible with multiple configs)
66
66
-q, --quiet report errors only - default: false
67
67
--ignore-path [file_name] file to use as your .solhintignore
68
68
--fix automatically fix problems and show report
@@ -111,9 +111,37 @@ This file has the following format:
111
111
"extends": "solhint:recommended"
112
112
}
113
113
```
114
-
### Note
114
+
### Note 1
115
115
The `solhint:default` configuration contains only two rules: max-line-length & no-console
116
116
It is now deprecated since version 5.1.0
117
+
<br>
118
+
119
+
### Note 2
120
+
Multiple configs files can be used at once. All config files should be named `.solhint.json`.
121
+
If not done like this, multiple hierarchy configuration will not work.
122
+
Solhint will go though all config files automatically.
123
+
124
+
Given this structure:
125
+
```
126
+
Project ROOT =>
127
+
/contracts
128
+
---> RootAndContractRules.sol
129
+
---> .solhint.json
130
+
131
+
/src
132
+
--->RootRules.sol
133
+
--->interfaces/
134
+
------->InterfaceRules.sol
135
+
------->solhint.json
136
+
137
+
.solhint.json
138
+
```
139
+
- Solhint config located on `root` will be the main one.
140
+
- When analyzing `RootRules.sol`, `root` file config will be used that file.
141
+
- `InterfaceRules.sol` will be using the one inside its own folder taking precedence over the `root` folder one.
142
+
- Rules not present in `interfaces/` folder and present in `root` will be active.
143
+
- Rules not present in `root` folder and present in `interfaces/` folder will be active.
144
+
- If rule is present in both files, the closest to the analyzed file will take precedence. Meaning when analyzing `InterfaceRules.sol` the config file located in `Interfaces/` will be used with the remaining rules of the `root` one.
0 commit comments