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

fix: exit check task with exit code 1 when solhint raises errors #5556

Merged
merged 9 commits into from
Aug 1, 2024

Conversation

galargh
Copy link
Member

@galargh galargh commented Jul 29, 2024

  • Because this PR includes a bug fix, relevant tests have been included.
  • Because this PR includes a new feature, the change was previously discussed on an Issue or with someone from the team.
  • I didn't do anything of this.

Resolves #5057

This PR modifies the hardhat-solhint plugin.

It changes the check task behaviour. After the changes, when solhint reports any errors (note, this does not apply to warnings), the task exists with error code 1.

The updated behaviour is in line with how solhint behaves as a standalone CLI tool.

Please note that this is, currently, a breaking change since it's modifying solhint plugin/check task behaviour. I will update the changesets and mark the PR as "ready for review", once we align on the open questions I outline below.

Open Questions

  1. Should we update solhint to the most recent version v5.0.2? Yes
  2. Should we control the newly added behaviour via configuration? If so, we could also support failing the check task when a threshold of warnings is crossed. In solhint, this is controlled via command line options. No (not yet, at least)

@galargh galargh requested a review from kanej July 29, 2024 12:54
Copy link

vercel bot commented Jul 29, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
hardhat ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 31, 2024 2:30pm

Copy link

changeset-bot bot commented Jul 29, 2024

🦋 Changeset detected

Latest commit: 570f79d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@nomiclabs/hardhat-solhint Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@kanej kanej added status:ready This issue is ready to be worked on and removed status:triaging labels Jul 29, 2024
@kanej
Copy link
Member

kanej commented Jul 29, 2024

I think we bump to version v5.0.2. We are taking the hit of a major update due to the breaking cli behaviour change; so lets move to the latest version at the same time.

I think we leave off of replicating the cli behaviour around warnings. This can be added later if there is demand.

@galargh galargh force-pushed the galargh/issue/5057 branch from 33c1b60 to cc79bd7 Compare July 29, 2024 16:36
@galargh galargh marked this pull request as ready for review July 29, 2024 16:46
Copy link
Member

@kanej kanej left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is looking good. I left two requests:

  1. splitting the changeset into two parts
  2. updating the exit technique if there are errors

Copy link
Member

@kanej kanej left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@galargh galargh merged commit dc85793 into main Aug 1, 2024
16 checks passed
@galargh galargh deleted the galargh/issue/5057 branch August 1, 2024 08:30
Copy link

gitpoap-bot bot commented Aug 1, 2024

Congrats, your important contribution to this open-source project has earned you a GitPOAP!

GitPOAP: 2024 Hardhat Contributor:

GitPOAP: 2024 Hardhat Contributor GitPOAP Badge

Head to gitpoap.io & connect your GitHub account to mint!

Learn more about GitPOAPs here.

@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:ready This issue is ready to be worked on
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

npx hardhat run check: raise error, exit code stays 0
2 participants