hardhat
hardhat copied to clipboard
npx hardhat run check: raise error, exit code stays 0
Version of Hardhat
2.22.2
What happened?
I'm using the hardhat-solhint plugin, when the litting process raise error, the exit code stays the 0, therefor command chaining with && don't break, which is a problem
Minimal reproduction steps
Running the linter as mentioned in the doc:
npx hardhat check && echo 'Error Code: '$?
An error arise during the linting but Exit Code stays 0
8:1 error Unexpected import of console file
no-console
8:1 warning global import of path hardhat/console.sol is not allowed. Specify names to import individually or bind all exports of the module into a name (import "path" as Name)
no-global-import
31:5 warning Explicitly mark visibility in function (Set ignoreConstructors to true if using solidity >=0.7.0)
func-visibility
56:9 warning Use Custom Errors instead of require statements
custom-errors
74:9 warning Use Custom Errors instead of require statements
custom-errors
76:9 warning Use Custom Errors instead of require statements
custom-errors
94:9 warning Use Custom Errors instead of require statements
custom-errors
114:9 warning Use Custom Errors instead of require statements
custom-errors
✖ 40 problems (1 error, 39 warnings)
Error Code: 0
Search terms
No response
I was able to reproduce this locally, by taking a new typescript sample project, adding the solhint plugin, running solhint --init and updating the config to:
{
"extends": "solhint:recommended"
}
On running npx hardhat check we don't get a non-zero exit code:
Because of this I think https://github.com/protofire/solhint/pull/554
Opened the issue https://github.com/protofire/solhint/issues/572
Thanks @madlabman, we will keep this open to track the issue coming in on the hardhat-solhint plugin.
@kanej just a heads up this was fixed in Solhint 5.0.1 :rocket:
Just note that upgrading to Solhint 5.0.1 would equate to a major version bump in the hardhat-solhint plugin.
Thanks for the report! This issue has now been fixed in the release @nomiclabs/[email protected]