hashicorp / hashicorp/hcl

Strict mode

Open
#109 3 comments 1 reaction 0 assignees View on GitHub
enhancement v1
Dominant language
Go
Stars
5.8k
Forks
657
Avg merge
20h 36m
Merged PRs (30d)
6

Description

It would be nice to have more strict mode of parsing with the option of tagging fields as required, as well as returning an error when superfluous fields are present.

Given the following struct and config `field1` is omitted and `field3` is a superfluous field.

``` go
type Section struct {
Name string `hcl:",key"`
Field1 string
Field2 string
}
```

``` hcl
section "Section1" {
field2 = "2"
field3 = "3"
}
```

The object returned is `[]main.Section{main.Section{Name:"Section1", Field1:"", Field2:"2"}}`

Contributor guide

No contributing guide indexed for this repository

Research direction

No files, tests, or parser entry points are named. Start by locating the Go code that decodes the shown struct and HCL configuration, then establish tests for omitted required fields and superfluous fields; done means strict parsing reports both cases while preserving the existing behavior by default.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.