Skip to content
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

(SDK-137) Adds Puppet Parser syntax validation #94

Merged
merged 8 commits into from
Jun 21, 2017

Conversation

bmjen
Copy link
Contributor

@bmjen bmjen commented Jun 20, 2017

Adds validation for puppet syntax using puppet parser validate.

This PR also includes various cleanups and refactoring of the validation handlers.

@@ -16,7 +20,8 @@ def self.parse_targets(options)
targets.map { |target|
if respond_to?(:pattern)
if File.directory?(target)
Array[pattern].flatten.map { |p| Dir.glob(File.join(target, p)) }
files_glob = Array[pattern].flatten.map { |p| Dir.glob(File.join(target, p)) }
files_glob.flatten.empty? ? target : files_glob
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why return target if there are no files that match the pattern?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

puppet-lint and puppet parser validate require a path input to work. The alternative is to not call them at all if no files match.

@DavidS DavidS added the feature label Jun 21, 2017
@DavidS DavidS merged commit 6e89da4 into puppetlabs:master Jun 21, 2017
@bmjen bmjen deleted the parser branch November 14, 2017 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants