puppet-lint: Wrong arrow alignment when key has interpolated variable

This code gets the following warning:

WARNING: indentation of => is not properly aligned on line 9

#
class example (
  $external_ip_base,
) {

  bar { 'xxxxxxxxxxx':
    inputs => {
      'ny' => {
        "${external_ip_base}.16:443"  => 'foo',
        'veryveryverylongstring8:443' => 'foo',
      },  
    },  
  }
}

The warning goes away if you remove the interpolated variable:

  6   bar { 'xxxxxxxxxxx':
  7     inputs => {
  8       'ny' => {
  9         'xxxxxxxxxxxxxxxxxxx.16:443'  => 'foo',
 10         'veryveryverylongstring8:443' => 'foo',
 11       },
 12     },
 13   } 

It also goes away if you add 3 spaces in front of the arrow:

  6   bar { 'xxxxxxxxxxx':
  7     inputs => {
  8       'ny' => {
  9         "${external_ip_base}.16:443"     => 'foo',
 10         'veryveryverylongstring8:443' => 'foo',
 11       },
 12     },
 13   } 

My theory is that the length of the string is being miscounted by 3 because the $, { and } are not counted. However I haven’t looked at the code.

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 20

Most upvoted comments

I’ll count that as a positive, as it’s then unrelated to this 😃 Would you mind opening another issue for that when you have time?