Replace syntax checks with puppet-syntax #73
Merged
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.
Use an external gem to check the syntax of Puppet manifests and templates
(and hiera YAML files, but these won't exist in most modules).
This gem has some additional features from the original checks:
I wasn't previously aware that these checks were in puppetlabs_spec_helper
until we got a bug report in voxpupuli/puppet-syntax#13 to say that
PuppetSyntax.exclude_paths
wasn't working correctly.It turns out that Rake was running the :syntax tasks from both projects and
that psh, where you can't configure exclude paths and no error message is
printed, was returning a non-zero exit code.
The :syntax task has been replaced by a require for puppet-syntax and the
exclude paths setup to match puppet-lint. I haven't wrapped this in a task
like :lint because it behaves non-deterministically; if the task from
puppet-syntax is run before this one then
exclude_paths
won't be setcorrectly.
The :validate task still checks Ruby files and then calls :syntax in place
of the shell commands it previously ran. There's quite a lot of overlap
between :validate and :syntax. In the future it might be worth adding Ruby
syntax checks for Puppet plugins to puppet-syntax and deprecating the
:validate task.
Also enabled support for the
FUTURE_PARSER
environment variable./cc @dalen @cmurphy who originally added these checks.
/cc @treydock who reported the error on puppet-syntax.