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

Closed
codekoriko opened this issue Apr 2, 2024 · 7 comments · Fixed by #5556
Closed

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

codekoriko opened this issue Apr 2, 2024 · 7 comments · Fixed by #5556
Assignees
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

@fvictorio fvictorio added this to Hardhat Apr 2, 2024
@github-project-automation github-project-automation bot moved this to Backlog in Hardhat Apr 2, 2024
@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 kanej moved this from Backlog to To-do in Hardhat 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 kanej moved this from To-do to Blocked in Hardhat 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.

@AlissonRS
Copy link

@kanej just a heads up this was fixed in Solhint 5.0.1 🚀

@kanej kanej moved this from Blocked to To-do in Hardhat Jul 26, 2024
@kanej
Copy link
Member

kanej commented Jul 26, 2024

Just note that upgrading to Solhint 5.0.1 would equate to a major version bump in the hardhat-solhint plugin.

@kanej kanej moved this from To-do to In Progress in Hardhat Jul 29, 2024
@kanej kanej moved this from In Progress to In Review in Hardhat Jul 30, 2024
@github-project-automation github-project-automation bot moved this from In Review to Done in Hardhat Aug 1, 2024
@galargh
Copy link
Member

galargh commented Aug 1, 2024

Thanks for the report! This issue has now been fixed in the release @nomiclabs/hardhat-solhint@4.0.0

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status:blocked Blocked by other issues or external reasons type:bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants