Skip to content
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

RFE: Provide a way to selectively disable checks in puppet source #508

Closed
ghost opened this issue Jul 18, 2016 · 3 comments
Closed

RFE: Provide a way to selectively disable checks in puppet source #508

ghost opened this issue Jul 18, 2016 · 3 comments

Comments

@ghost
Copy link

ghost commented Jul 18, 2016

Would it be possible to be able to selectively disable checks from the puppet source itself? A possible example of syntax to do this could be something like...

$foo = "${bar}";  # convert ${bar} to a string @(only_variable_string)

The issue I'm starting to run into all over the place is Forge puppet modules that specifically require input to be strings. The only way to convert a non-string variable to a string value in Puppet (at least, Puppet before version 4.5) is by enclosing the variable reference in double-quotes; however, this causes puppet-lint to complain about a string containing only a variable. Since I don't want to disable all checks for strings containing only a variable, this means that at the moment I have to do hacks like:

$foo = "x${bar}"[1,-1] # convert ${bar} to a string and avoid the lint complaint

This would be also be generally useful for other corner cases where puppet lint incorrectly flags code for warnings or errors (such as the previous behavior regarding variables defined in future-parser lambda blocks).

@rnelson0
Copy link
Collaborator

@jearls I believe that control comments is what you are looking for. You can do this by line or by a whole block of code. Let us know if this helps.

@rnelson0 rnelson0 added feature and removed feature labels Aug 2, 2016
@rnelson0
Copy link
Collaborator

rnelson0 commented Aug 2, 2016

@jearls I'm going to close this but feel free to re-open or open a new ticket if control comments is not what you need. Thanks!

@rnelson0 rnelson0 closed this as completed Aug 2, 2016
@ghost
Copy link
Author

ghost commented Aug 2, 2016

Oh - sorry I forgot to reply! Yes, control comments are exactly what I was looking for.

As a side note - for folks (like me) who don't (or didn't) know about puppet-lint.com, maybe a pointer to it in the top level README.md file would be useful :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant