pdk validate
: Rubocop config errors are not displayed in the default output level
#1065
Unanswered
sanfrancrisko
asked this question in
Feature Request
Replies: 1 comment 2 replies
-
From last conversation, @DavidS recommended Jon try the |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Originally reported in PDK-1680:
Environment
Description
Errors from Rubocop (and possibly other tools) are swallowed by PDK, instead of reporting to the user.
To recreate:
The only indication that there is an issue is that there is a cross instead of a tick in the basic pdk output for ruby:
This isn't very obvious and isn't being picked up by our automated tests currently (we use the actual output).
Impact
Ruby issues could go undetected due to a misconfiguration of rubocop
How this was identified
By default rubocop is (for some reason) set to validate against quite an old version of ruby as the minimum version (2.1).
This gave us errors related to newer formats, so we updated the value of TargetRubyVersion parameter to 2.5, this then gave no output at all (as the included rubocop gem is old, it doesn't support 2.5 despite 2.5 being the version puppet uses now).
By running with --debug we identified that pdk had swallowed the rubocop config error.
We suspect pdk behaves the same way for other tool config errors too.
Return code?
It does appear that pdk has a exit code of 2 when this happens, compared to 1 for "normal error output"
The documentation simply says:
"The exit code is non-zero when errors occur."
Is there more detail that can be documented? as using the return code can be very helpful for test automation
Beta Was this translation helpful? Give feedback.
All reactions