Adds a new puppet-lint check to verify a number of whitespace issues (newlines etc.)
These checks are very opinionated.
--fix support: Yes
To use this plugin, add the following line to the Gemfile in your Puppet code
base and run bundle install
.
gem 'puppet-lint-manifest_whitespace-check'
This plugin provides a number of new checks to puppet-lint
.
There should be a single space or single newline after an opening curly brace
Exceptions: other brackets or comma's
There should be a single space before an opening bracket
Exceptions: other brackets
Good examples:
class myclass (
# the parameters
) {
# the body
}
class myclass {
# the body
}
class myclass {
$value = [{ 'key' => 'value' }]
if somecondition {
class { 'someclass': }
}
}
Bad examples:
class myclass (
# the parameters
)
{
# the body
}
class myclass (
# the parameters
){
# the body
}
class myclass
{
# the body
}
class myclass {
if somecondition{
class{ 'someclass': }
}
}
There should be a single newline at the end of a manifest.
Not zero, not two or more. Be advised: this single newline is implicit at the end of your last line of code. This check does not add a single empty line!
There should be a single newline at the end of a manifest.
Not zero, not two or more. Be advised: this single newline is implicit at the end of your last line of code. This check does not add a single empty line!
There should be a single space after an arrow.
When you list resource parameters or build a hash, you usually use arrow operators (=>
). There are checks that make sure your arrows are aligned, but this check will ensure the number of spaces after your arrows is consistently 1.
There should not be a newline at the beginning of a manifest.
There should not be empty lines at the beginning of your file.
There should be a single space between the class or defined resource statement and the name.
Good examples:
class myclass (
# the parameters
) {
# the body
}
class myclass {
# the body
}
Bad example:
class myclass (
# the parameters
) {
# the body
}
There should be a single space between the class or resource name and the first brace.
Good examples:
class myclass (
# the parameters
) {
# the body
}
class myclass {
# the body
}
Bad example:
class myclass(
# the parameters
){
# the body
}
class myclass (
# the parameters
){
# the body
}
class myclass
(
# the parameters
){
# the body
}
This project is licensed unter MIT
This plugin was originally maintained by Jo Vandeginste. The maintainer preferred that Vox Pupuli take ownership of the module for future improvement and maintenance.
To make a new release, please do:
- update the version in the gemspec file
- Install gems with
bundle install --with release --path .vendor
- generate the changelog with
bundle exec rake changelog
- Check if the new version matches the closed issues/PRs in the changelog
- Create a PR with it
- After it got merged, push a tag. GitHub actions will do the actual release to rubygems and GitHub Packages