Skip to content

Instantly share code, notes, and snippets.

@JakeTRogers
Last active October 24, 2017 00:50
Show Gist options
  • Save JakeTRogers/dd95d4ebbfdf7e6254a605df328f6726 to your computer and use it in GitHub Desktop.
Save JakeTRogers/dd95d4ebbfdf7e6254a605df328f6726 to your computer and use it in GitHub Desktop.
puppet guard
notification :off
guard :shell do
watch %r{^(manifests|site\/(profile|role)\/manifests)\/(.+)\.pp$} do
system("pdk validate puppet") and system("pdk test unit")
end
watch %r{^(lib|site\/(profile|role)\/lib)\/(.+)\.rb$} do
system("pdk validate ruby") and system("pdk test unit")
end
watch %r{^spec\/(classes|defines|applications|functions|types|type_aliases|hosts)\/(.+)\.rb$} do
system("pdk validate ruby") and system("pdk test unit")
end
end
@DavidS
Copy link

DavidS commented Sep 5, 2017

You could improve this by narrowing the validate to pdk validate puppet and pdk validate ruby respectively. There are no interdependencies between the two checkers.

@JakeTRogers
Copy link
Author

Thanks David, thats a great suggestion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment