The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Puppet::Tidy - Tidies up your Puppet manifests

SYNOPSIS

use Puppet::Tidy;

Puppet::Tidy::puppettidy(
    source		=> $source,
    destination	=> \@destination
);

DESCRIPTION

This module parses the Puppet code and applies a subset of checks from the Puppet Style Guide onto it. Currently the set of checks is rather limited, but already enough is implemented to catch common mistakes and to save you a great deal of time cleaning up your manifests.

The Puppet Style Guide can be found at http://docs.puppetlabs.com/guides/style_guide.html.

CHECKS

Currently the following checks are implemented:

expand_tabs

No literal tabs are allowed, this method converts literal tabs to two spaces.

trailing_whitespace

Removes trailing whitespace.

variable_string

Strings which only contain a variable, mustn't be quoted.

quotes_resource_ref_type

Check for an idiom where reference resource types (File, Package, Group)
have a double quoted string as argument. This requires the
variable_string() method to be called before.

quotes_title

Resource titles should be single quoted, unless they contain a variable.
In which case they should be double quoted.

quotes_attribute

Attributes should be enclosed in single quotes, unless they
contain a variable in which case either double or no quoting
is needed.

handle_modes

File modes should be defined using four digits, not three as often
done by mistake.

commenting

Although Puppet supports C (/**/) and C++ (//) style comments, it's
advised to use regular Puppet comments which use a pound sign (#).

quoted_booleans

Booleans mustn't be quoted, since this means they're not nil, and will
thus evaluate to true. These errors are not fixed by Puppet::Tidy since
changing 'false' to true actually changing the meaning of a statement.
Instead, a warning is inserted into the file.

LICENSE

This module is free software, can you redistribute it and/or modify it under the terms of the ISC license. The full license text can be found in this module's LICENSE file.

CREDITS

Thanks to M:tier Ltd. (http://www.mtier.org/) for sponsoring development of this module.

AUTHOR

Jasper Lievisse Adriaanse