puppet-lint icon indicating copy to clipboard operation
puppet-lint copied to clipboard

I should be able to make lint ignore blocks of code

Open trevor-vaughan opened this issue 8 years ago • 7 comments

I have a case where the linter is crashing when processing an inline template but the template is valid. I should be able to tell lint to ignore a chunk of code altogether.

trevor-vaughan avatar Dec 13 '16 22:12 trevor-vaughan

@trevor-vaughan have you looked at http://puppet-lint.com/controlcomments/?

walkamongus avatar Dec 13 '16 22:12 walkamongus

@walkamongus Yes, I didn't see one for "just don't process this stuff"

This is particularly relevant until HEREDOC support is fixed since the linter is getting really upset with lots of different configurations and I fundamentally need to tell it to skip parsing the code up until the next # lint:endignore statement.

I'm working around it by doing horrible things with variables but I really shouldn't need to.

trevor-vaughan avatar Dec 13 '16 23:12 trevor-vaughan

It looks like you want a control comment to turn off all checks, correct?

Can you also provide file contents that caused the linter to crash? I think we would like to track that down even if it is in a different ticket.

rnelson0 avatar Dec 14 '16 00:12 rnelson0

@rnelson0 Yes, and ignore parsing the code between the comments

It was something like the following:

file { 'stuff':
  content => inline_template(@(EOM)
    template(name="" type="list") {
      
        ()
      
    }
    |EOM
}

trevor-vaughan avatar Dec 14 '16 00:12 trevor-vaughan

@trevor-vaughan does your crash look the same as in #578?

rnelson0 avatar Dec 14 '16 02:12 rnelson0

@rnelson0 It was similar but I don't remember exactly. I rewrote the code and didn't keep the old version around, sorry.

trevor-vaughan avatar Dec 14 '16 02:12 trevor-vaughan

~On this I've tried to make the linter ignore the errors it gives, but it ignores my ignore lines...~

EDIT: I dunno what's changed but all of a sudden it's allowing me to ignore things. o.o;

ElvenSpellmaker avatar Dec 10 '18 17:12 ElvenSpellmaker