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
Show HCL parsing errors and typos #1200
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jefferai
force-pushed
the
sethvargo/hcl_errors
branch
from
March 10, 2016 19:51
dd6e384
to
eddab03
Compare
sethvargo
force-pushed
the
sethvargo/hcl_errors
branch
from
March 10, 2016 19:52
eddab03
to
71b550e
Compare
This does NOT apply to the backend config, since each backend config could have a variation of options that differ based off of the configured backend itself. This may be an optimization that can be made in the future, but I think each backend should be responsible for performing its own configuration validation instead of overloading the config itself with this functionality.
sethvargo
force-pushed
the
sethvargo/hcl_errors
branch
from
March 10, 2016 20:25
71b550e
to
b47a8b1
Compare
This was a flawed test. Previously the test passed in a fixture that corresponded to a CLI config file, not an actual policy. The test _should_ have been failing, but it wasn't. This commit adds a new fixture.
sethvargo
force-pushed
the
sethvargo/hcl_errors
branch
from
March 10, 2016 22:00
3e45469
to
e5e6653
Compare
jefferai
added a commit
that referenced
this pull request
Mar 11, 2016
Show HCL parsing errors and typos
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR makes Vault's UX around bad HCL keys and errors a little bit better by clearly calling out the line number where a violation occurred and the violation itself.
You can take a look at the added tests to understand what the output looks like, but here are some examples:
Thanks @jefferai for helping and @mitchellh for teaching me all the HCL insides!