Open ddnexus opened 2 years ago
@ddnexus Solhint works like this. Given this file structure: (Brackets name represent folders just for better understanding)
[contracts] contracts\ONE.sol contracts\TWO.sol [contracts\adapters] contracts\adapters\THREE.sol contracts\adapters\FOUR.sol [contracts\adapters\uniswap] contracts\adapters\uniswap\UNI.sol
If you want to run solhint on all files:
solhint contracts/*.* contracts/**/*.* contracts/**/**/*.*
If you want to run solhint on adapters folders and all of subfolders
solhint contracts/**/*.* contracts/**/**/*.*
If you want to exclude FOUR.sol and run in all other files:
Fill .solhintignore with this line
contracts/adapters/FOUR.sol
Then run
solhint contracts/*.* contracts/**/*.* contracts/**/**/*.*
FOUR.sol will be excluded
From your post I think you want to put a folder in the .solhintignore and with that notation you want to ignore the whole folder but not the file with the exclamation point, meaning:
If I put in .solhintignore this:
contracts/adapters/
!contracts/adapters/FOUR.sol
You want solhint to process only FOUR.sol from adapters folder... Is that correct ?
Yes, that's how gitignore works!
Without it you would have to check the structure of contracts/adapters/
and update the many solhint arguments every time it changes.
thanks for the clarification it is a good addition we'll try to add that
BTW, the "file" could also be a pattern itself.
The pattern to ignore a dir excluding specific files in
.gitignore
does not seem to work: