* refactor so that json and hcl2 templates are both prepared in the same place in the build call, to make code easier to reason about. Remove overly verbose error output which isn't useful in vast majority of cases
* fix tests
* check err msg
* hcl2template.PackerConfig.GetBuilds: raise a diagnostic in case the packer core build perpare call errors
Co-authored-by: Adrien Delorme <adrien.delorme@icloud.com>
to allow just reading the config and to not start anything. This will allow to later on run `validate --syntax-only`.
Note that none of the builder/provisioner/post-processor config will be read but simply ignored. HCL2 still needs the body to be properly formatted and it should detect most syntax errors.
* Add golangci-lint as linting tool
* Disable failing staticchecks to start; GitHub issue to handle coming soon
* Run `goimports -w` to repair all source files that have improperly
formatted imports
* makefile: Add ci-lint target to run on travis
This change adds a new make target for running golangci-lint on newly
added Go files only. This target is expected to run during Packer ci builds.
* .github/contributing: Add code linting instructions
* travis: Update job configuration to run parallel builds