No release in over a year
A puppet-lint plugin to check & fix class params/equals alignment.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

>= 1.0, < 3.0
 Project Readme

puppet-lint-class_alignment-check

License Test Release codecov RubyGem Version RubyGem Downloads

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',
) {

}