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

Add validations for HardhatUserConfig.paths #5665

Open
zoeyTM opened this issue Aug 22, 2024 · 2 comments
Open

Add validations for HardhatUserConfig.paths #5665

zoeyTM opened this issue Aug 22, 2024 · 2 comments
Labels
status:ready This issue is ready to be worked on v-next A Hardhat v3 development task

Comments

@zoeyTM
Copy link
Contributor

zoeyTM commented Aug 22, 2024

The paths field was added in parallel with the config validations and slipped through the cracks of being included. We should add some simple validations for them inside v-next/core/src/internal/config-validation.ts (probably in the collectValidationErrorsForUserConfig function)

@zoeyTM zoeyTM added the v-next A Hardhat v3 development task label Aug 22, 2024
@zoeyTM zoeyTM added status:ready This issue is ready to be worked on and removed status:triaging labels Aug 22, 2024
@Tmthang1601
Copy link

Hi @zoeyTM , I cant find any collectValidationErrorsForUserConfig function in config-validation.ts, Can you explain the issue more clearly, I really wanna do it

@Tmthang1601
Copy link

Hi, I have added validation checks for the paths field in the collectValidationErrorsForUserConfig function. Specifically:

  • Check if paths is an object.

  • For each path in paths:

  1. Check if it is a string.

  2. Check if it is an absolute path.

  3. Check if the path exists.

Validation errors will be added to the validationErrors array if any of these checks fail.

I am planning to create a pull request for you to review, and I look forward to your feedback as I am eager to have my PR successfully merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:ready This issue is ready to be worked on v-next A Hardhat v3 development task
Projects
Status: To-do
Development

No branches or pull requests

3 participants