Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
genebean opened this issue Jan 17, 2020 · 2 comments
Open

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

genebean opened this issue Jan 17, 2020 · 2 comments

Comments

@genebean
Copy link

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

  • default and the titles are two spaces in from the resource declaration
  • the parameters are two spaces in from the title (or default)
  • that the semicolon is aligned with the title if parameters are provided
  • that the semicolon is either aligned with the title or one space out from the colon when no parameters are provided
telegraf::input {
    default:
      options => [{
        'interval' => '15s',
      }],
    ;
    'diskio': ;
    'mem': ;
    'net':
      options => [{
        'interval'              => '15s',
        'ignore_protocol_stats' => true,
        'interfaces'            => ['eth*', 'enp0s[0-1]', 'ens192'],
      }],
    ;
}
@rodjek
Copy link
Owner

rodjek commented Feb 8, 2020

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

@genebean
Copy link
Author

genebean commented Feb 8, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants