rodjek / puppet-lint

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

[feature request] alignment for multi-resource declarations #911

Open genebean opened 4 years ago

genebean commented 4 years ago

I would like to see support, either natively or via a plugin, for formatting multi-resource declarations. In particular, I am wanting to make sure that in a block like what’s below that

telegraf::input {
    default:
      options => [{
        'interval' => '15s',
      }],
    ;
    'diskio': ;
    'mem': ;
    'net':
      options => [{
        'interval'              => '15s',
        'ignore_protocol_stats' => true,
        'interfaces'            => ['eth*', 'enp0s[0-1]', 'ens192'],
      }],
    ;
}
rodjek commented 4 years ago

This should be implemented as a plugin rather than a core check as the style guide recommends against using the condensed resource format.

genebean commented 4 years ago

No objection to it being a plugin. The style guide doesn’t seem to be discouraging these so long as a default body is present: https://puppet.com/docs/puppet/latest/style_guide.html#resource-arrangement It seems to only discourage them when the resources are unrelated.

Sent with GitHawk