rodjek / puppet-lint

Check that your Puppet manifests conform to the style guide
MIT License
819 stars 204 forks source link

False positive on when using a method on a variable #937

Open b4ldr opened 3 years ago

b4ldr commented 3 years ago

I noticed the following code triggers WARNING: unquoted resource title on line 3

$foo = '/tmp/file.conf'
notice($foo.dirname)
file{$foo.dirname:}
$ puppet apply ~/puppet_tests/puppet-lint_issue.pp                                                   
Notice: Scope(Class[main]): /tmp
Notice: Compiled catalog for desktop.home.arpa in environment production in 0.01 seconds
Notice: Applied catalog in 0.01 seconds
$ /usr/local/bin/puppet-lint -v  
puppet-lint 2.4.2
$ /usr/local/bin/puppet-lint ~/puppet_tests/puppet-lint_issue.p
WARNING: unquoted resource title on line 3

The following code does pass puppet-lint

$foo = '/tmp/file.conf'
notice($foo.dirname)
file{$foo.dirname():}