-
Notifications
You must be signed in to change notification settings - Fork 104
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
Conversation
@@ -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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
Adds validation for puppet syntax using
puppet parser validate
.This PR also includes various cleanups and refactoring of the validation handlers.