You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We recently encountered a bug when applying puppet-lint fixes in a CI pipeline that did not have a subsequent syntax check. The issue is that in some cases, puppet-lint --fix will "fix" the code in such a way that it is broken.
When running puppet-lint against this file, it complains about the indentation of => being wrong. But if you run puppet-lint --fix, it will produce a file that looks like this:
file{'/abc':
ensure =>directory
owner =>test
group =>test,
mode =>'0755',
}
Note the missing commas. I guess what is happening is some kind of off-by-one error where the commas are replaced by newline+indent, because this doesn't happen if the source file had spaces after the commas.
Something that might be nice (although I am not sure how easy it would be to do) is if puppet-lint could also run a syntax check on the files it supposedly fixed as a sanity check.
The text was updated successfully, but these errors were encountered:
We recently encountered a bug when applying puppet-lint fixes in a CI pipeline that did not have a subsequent syntax check. The issue is that in some cases, puppet-lint --fix will "fix" the code in such a way that it is broken.
Test case:
When running puppet-lint against this file, it complains about the indentation of
=>
being wrong. But if you run puppet-lint --fix, it will produce a file that looks like this:Note the missing commas. I guess what is happening is some kind of off-by-one error where the commas are replaced by newline+indent, because this doesn't happen if the source file had spaces after the commas.
Something that might be nice (although I am not sure how easy it would be to do) is if puppet-lint could also run a syntax check on the files it supposedly fixed as a sanity check.
The text was updated successfully, but these errors were encountered: