Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npx hardhat run check: raise error, exit code stays 0 #5057

Open
codekoriko opened this issue Apr 2, 2024 · 4 comments
Open

npx hardhat run check: raise error, exit code stays 0 #5057

codekoriko opened this issue Apr 2, 2024 · 4 comments
Labels
status:blocked Blocked by other issues or external reasons type:bug Something isn't working

Comments

@codekoriko
Copy link

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

@kanej kanej added type:bug Something isn't working status:ready This issue is ready to be worked on and removed status:triaging labels Apr 2, 2024
@kanej
Copy link
Member

kanej commented Apr 2, 2024

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:

image

@kanej kanej removed their assignment Apr 8, 2024
@madlabman
Copy link

Because of this I think protofire/solhint#554

@madlabman
Copy link

Opened the issue protofire/solhint#572

@kanej kanej added status:blocked Blocked by other issues or external reasons and removed status:ready This issue is ready to be worked on labels Apr 10, 2024
@kanej
Copy link
Member

kanej commented Apr 10, 2024

Thanks @madlabman, we will keep this open to track the issue coming in on the hardhat-solhint plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:blocked Blocked by other issues or external reasons type:bug Something isn't working
Projects
Status: Blocked
Development

No branches or pull requests

3 participants