Skip to content

Commit

Permalink
fix: terramate.config.git block with unrecognized blocks (#359)
Browse files Browse the repository at this point in the history
  • Loading branch information
i4ki committed May 30, 2022
1 parent 3f4b4a3 commit 0d41f4a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions hcl/hcl.go
Expand Up @@ -760,15 +760,20 @@ func parseRootConfig(cfg *RootConfig, block *hclsyntax.Block) error {
return errs.AsError()
}

func parseGitConfig(git *GitConfig, block *hclsyntax.Block) error {
func parseGitConfig(git *GitConfig, gitBlock *hclsyntax.Block) error {
logger := log.With().
Str("action", "parseGitConfig()").
Logger()

logger.Trace().Msg("Range over block attributes.")

errs := errors.L()
for _, attr := range sortedAttributes(block.Body.Attributes) {

for _, block := range gitBlock.Body.Blocks {
errs.Append(errors.E(block.TypeRange, "unrecognized block %q", block.Type))
}

for _, attr := range sortedAttributes(gitBlock.Body.Attributes) {
attrVal, diags := attr.Expr.Value(nil)
if diags.HasErrors() {
errs.Append(errors.E(diags,
Expand Down

0 comments on commit 0d41f4a

Please sign in to comment.