-
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-285) Add --auto-correct flag to validators that support it #104
Conversation
@@ -1,7 +1,8 @@ | |||
|
|||
shared_context 'in a new module' do |name| | |||
before(:all) do | |||
system("pdk new module #{name} --skip-interview") || raise | |||
output = `pdk new module #{name} --skip-interview` |
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.
I'm not sure this captures stderr, appending 2>&1 should work on all platforms
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.
LGTM - added a small adjustment to acceptance so that we get stderr if module folder creation fails
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.
Even if there are no puppet-lint acceptance tests yet, please do start them when you're adding to it. The lack of testing over there, won't get better by ignoring it!
@@ -1,7 +1,8 @@ | |||
|
|||
shared_context 'in a new module' do |name| | |||
before(:all) do | |||
system("pdk new module #{name} --skip-interview") || raise | |||
output = `pdk new module #{name} --skip-interview 2>&1` |
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.
@@ -1,7 +1,8 @@ | |||
|
|||
shared_context 'in a new module' do |name| | |||
before(:all) do | |||
system("pdk new module #{name} --skip-interview") || raise | |||
output = `pdk new module #{name} --skip-interview 2>&1` | |||
raise "Failed to create test module:\n#{output}" unless File.directory?(name) |
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.
Then you can also raise
here on the exit status returned from capture2e, and not rely on environmental factors.
Please also add a note to the README about how and where to use this flag. |
Sorry, didn't mean to imply that I was ignoring the lack of tests. I knew that puppet-lint integration was still a work in progress with open tickets and didn't want to duplicate work. |
Updated the |
Acceptance tests for puppet-lint integration added in #109. Once they are merged in, I'll come back to this and add acceptance tests for puppet-lint with --auto-correct. |
4fd8f8f
to
b3d5ad5
Compare
@DavidS acceptance tests added for auto-correcting puppet-lint problems |
This will just silently no-op for validators that don't support auto correction. There's no acceptance tests for puppet-lint integration at the moment, so I've only added an acceptance test for auto-correcting rubocop violations.