puppet-lint-class_alignment-check
A puppet-lint plugin to check and fix class params/equals alignment.
Usage
This plugin provides 3 checks for puppet-lint:
class_params_newline
class_params_alignment
class_equals_alignment
It supports --fix
flag.
To properly reformat the code, run puppet-lint --fix
like this:
$ puppet-lint --only-checks class_params_newline --fix .
$ puppet-lint --only-checks class_params_alignment --fix .
$ puppet-lint --only-checks class_equals_alignment --fix .
# It's best to combine the above checks with `strict_indent` to fix all remaining issues
$ puppet-lint --only-checks strict_indent --fix .
Parameters to classes or defined types must be uniformly indented in two spaces from the title. The equals sign should be aligned.
https://puppet.com/docs/puppet/7/style_guide.html#style_guide_classes-param-indentation-alignment
class name (
$var1 = 'default',
$var2 = 'something else',
$another = 'another default value',
) {
}
class name (
Boolean $broadcastclient = false,
Optional[Stdlib::Absolutepath] $config_dir = undef,
Enum['running', 'stopped'] $service_ensure = 'running',
String $package_ensure = 'present',
) {
}