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

Introduce decoder.ValidateFile #310

Merged
merged 4 commits into from
Aug 31, 2023
Merged

Introduce decoder.ValidateFile #310

merged 4 commits into from
Aug 31, 2023

Conversation

dbanck
Copy link
Member

@dbanck dbanck commented Aug 31, 2023

This PR adds a new method to the decoder for validating a single file

@dbanck dbanck added the enhancement New feature or request label Aug 31, 2023
@dbanck dbanck self-assigned this Aug 31, 2023
@dbanck dbanck requested a review from a team as a code owner August 31, 2023 09:31
@dbanck dbanck changed the title Indroduce decoder.ValidateFile Introduce decoder.ValidateFile Aug 31, 2023

body, ok := f.Body.(*hclsyntax.Body)
if !ok {
// TODO! error
Copy link
Member

Choose a reason for hiding this comment

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

👀

I think we should mimic what we do in other similar methods already - i.e. return error to say that JSON isn't supported.

@@ -48,6 +48,28 @@ func (d *PathDecoder) Validate(ctx context.Context) (lang.DiagnosticsMap, error)
return diags, nil
}

// ValidateFile returns a list of Diagnostics for a specific file
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// ValidateFile returns a list of Diagnostics for a specific file
// ValidateFile validates given file and returns a list of Diagnostics for that file

Nitpick

@dbanck dbanck requested a review from radeksimko August 31, 2023 09:54
Copy link
Member

@radeksimko radeksimko left a comment

Choose a reason for hiding this comment

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

Dog Human Fashion

@dbanck dbanck merged commit 485c607 into main Aug 31, 2023
4 checks passed
@dbanck dbanck deleted the f-single-file-validation branch August 31, 2023 10:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants