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

User config validation #5528

Merged
merged 3 commits into from
Jul 31, 2024
Merged

User config validation #5528

merged 3 commits into from
Jul 31, 2024

Conversation

zoeyTM
Copy link
Contributor

@zoeyTM zoeyTM commented Jul 17, 2024

This PR adds validation for all the currently supported fields in HardhatUserConfig (currently just tasks and plugins).

Fixes #5230

Copy link

vercel bot commented Jul 17, 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 30, 2024 6:16am

Copy link

changeset-bot bot commented Jul 17, 2024

⚠️ No Changeset found

Latest commit: 13b133b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

Copy link
Member

@schaable schaable left a comment

Choose a reason for hiding this comment

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

I left a couple of comments. There are two things I'm not completely sure about:

  • Doing the validations manually vs using Zod. I think this might be achievable with Zod, and it would probably look nicer. However, I haven't used Zod before, so I could be wrong.
  • There are some duplicate validations between this PR and tasks. I'm inclined to say we should remove them either here or in the task manager/builders, unless these validations don't run in some scenarios.

@zoeyTM
Copy link
Contributor Author

zoeyTM commented Jul 23, 2024

pushed up a commit addressing most of the comments. i'm working on a further update to validate via zod instead, but it won't be ready until tomorrow.

@zoeyTM
Copy link
Contributor Author

zoeyTM commented Jul 30, 2024

After discussing pros/cons with Pato, we agreed that manual validation was the preferred choice as opposed to full config validation via zod.

@zoeyTM zoeyTM marked this pull request as ready for review July 30, 2024 05:48
@zoeyTM zoeyTM force-pushed the config-validation branch from 5d7203c to 13b133b Compare July 30, 2024 06:15
@zoeyTM zoeyTM merged commit 9d948b9 into v-next Jul 31, 2024
51 checks passed
@zoeyTM zoeyTM deleted the config-validation branch July 31, 2024 15:02
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
v-next A Hardhat v3 development task
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants