rodjek / puppet-lint

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

Certain characters in strings suppressing legit warnings #944

Open sanfrancrisko opened 3 years ago

sanfrancrisko commented 3 years ago

Originally reported in https://github.com/puppetlabs/pdk/issues/1076

Puppet Lint Version: 2.4.2

It appears as though certain characters are causing error messages to be suppressed. Take this class:

# a.pp
class a::t {
    if $x == 1 {
        fail("½ ${x}")
        notify { "${x}": }
    }
}

If you run puppet-lint against it, you will receive the following errors:

WARNING: string containing only a variable on line 10
WARNING: fail(½ ) should be decorated but interpolation is not supported at this time. on line 9

Note: The second message (fail(½ )) is coming from puppet-lint-il8n.

However, when you replace the ½ char with a you get these expected warnings:

WARNING: top-scope variable being used without an explicit namespace on line 8
WARNING: top-scope variable being used without an explicit namespace on line 9
WARNING: top-scope variable being used without an explicit namespace on line 10
WARNING: string containing only a variable on line 10
WARNING: fail(a ) should be decorated but interpolation is not supported at this time. on line 9