Skip to content

Commit

Permalink
early validation - bump hcl-lang and reflect upstream changes (#1416)
Browse files Browse the repository at this point in the history
* deps: bump hcl-lang to aa9b38d (#1414)

* re-define decoupled validators
  • Loading branch information
radeksimko committed Sep 20, 2023
1 parent 1ab1358 commit 8b0c012
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions internal/decoder/decoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ func modulePathContext(mod *state.Module, schemaReader state.SchemaReader, modRe
ReferenceTargets: make(reference.Targets, 0),
Files: make(map[string]*hcl.File, 0),
Functions: coreFunctions(mod),
Validators: moduleValidators,
}

for _, origin := range mod.RefOrigins {
Expand Down
19 changes: 19 additions & 0 deletions internal/decoder/validators.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package decoder

import (
"github.com/hashicorp/hcl-lang/validator"
)

var moduleValidators = []validator.Validator{
validator.BlockLabelsLength{},
validator.DeprecatedAttribute{},
validator.DeprecatedBlock{},
validator.MaxBlocks{},
validator.MinBlocks{},
validator.MissingRequiredAttribute{},
validator.UnexpectedAttribute{},
validator.UnexpectedBlock{},
}

0 comments on commit 8b0c012

Please sign in to comment.