No commit activity in last 3 years
No release in over 3 years
A puppet-lint plugin to check for empty lines around the body of blocks.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

puppet-lint-empty_lines_around_body-check

A puppet-lint plugin to check for empty lines around bodies of

  • classes and defined types
  • conditional blocks (if/elsif/else, unless, case, selectors, ...)

Installation

From the command line

$ gem install puppet-lint-empty_lines_around_body-check

Checks

What you have done

There is an empty line either after the opening curly brace that starts a block or before the closing curly brace that ends a block.

if $foo == 'bar' {

  ## some stuff

}
class foo::config {

  ## some stuff

}
case $facts['os']['name'] {

  'Solaris': { include role::solaris }
  default:   { include role::generic }

}

What you should have done

The indentation suffices to signal the start end end of a block, so blocks shouldn't have leading or trailing empty lines.

if $foo == 'bar' {
  ## some stuff
}
class foo::config {
  ## some stuff
}
case $facts['os']['name'] {
  'Solaris': { include role::solaris }
  default:   { include role::generic }
}

Disabling the check

To disable this check, you can add `--no-empty_lines_around_block-check' to your puppet-lint command line.

$ puppet-lint --no-empty_lines_around_block-check /path/to/file.pp

Acknowledgments

This plugin for puppet-lint has been written owing to the very nice tutorial for writing puppet-lint checks.