Skip to content
This repository
Newer
Older
100644 79 lines (56 sloc) 2.742 kb
e3d32683 »
2011-08-21 Actually put something in README.md
1 # Puppet-lint
2
3 The goal of this project is to implement as many of the recommended Puppet
34b7f42e »
2011-08-22 formatting
4 style guidelines from the [Puppet Labs style
91f5968e »
2011-08-21 Tweak README formatting
5 guide](http://docs.puppetlabs.com/guides/style_guide.html) as practical.
e3d32683 »
2011-08-21 Actually put something in README.md
6
7 ## Installation
8
9 gem install puppet-lint
10
11 ## Testing your manifests
12
13 You can test a single manifest file by running
14
15 puppet-lint <path to file>
16
17 If you want to test your entire Puppet manifest directory, you can add
18 `require 'puppet-lint/tasks/puppet-lint'` to your Rakefile and then run
19
20 rake lint
21
22 ## Implemented tests
23
24 At the moment, the following tests have been implemented:
25
26 ### Spacing, Indentation & Whitespace
27
e54c4692 »
2011-08-21 Preceeding whitespace missing from first bullet point.
28 * Must use two-space soft tabs.
e3d32683 »
2011-08-21 Actually put something in README.md
29 * Must not use literal tab characters.
30 * Must not contain trailing white space.
31 * Should not exceed an 80 character line width
32 * An exception has been made for `source => 'puppet://...'` lines as
33 splitting these over multiple lines decreases the readability of the
34 manifests.
35 * Should align arrows (`=>`) within blocks of attributes.
36
37 ### Quoting
38
39 * All strings that do not contain variables should be enclosed in single
40 quotes.
5c2ea640 »
2011-09-10 Allow double quoted strings containing newlines or tabs
41 * An exception has been made for double quoted strings containing \n or \t.
e3d32683 »
2011-08-21 Actually put something in README.md
42 * All strings that contain variables must be enclosed in double quotes.
43 * All variables should be enclosed in braces when interpolated in a string.
170a89de »
2011-08-21 Check for strings that only contain a single variable
44 * Variables standing by themselves should not be quoted.
e3d32683 »
2011-08-21 Actually put something in README.md
45
46 ### Resources
47
48 * All resource titles should be quoted.
49 * If a resource declaration includes an `ensure` attribute, it should be the
50 first attribute specified.
3f51da6e »
2011-08-21 Check that symlinks are created with a target attribute
51 * Symbolic links should be declared by using an ensure value of `link` and
52 explicitly specifying a value for the `target` attribute.
e3d32683 »
2011-08-21 Actually put something in README.md
53 * File modes should be represented as a 4 digit string enclosed in single
54 quotes.
55
91f5968e »
2011-08-21 Tweak README formatting
56 ### Conditionals
a27948ed »
2011-08-21 Check that selectors aren't used in resource declarations
57
58 * You should not intermingle conditionals inside resource declarations (i.e.
59 selectors inside resources).
7a20ead0 »
2011-08-21 Check that case statements have a default case
60 * Case statements should have a default case.
a27948ed »
2011-08-21 Check that selectors aren't used in resource declarations
61
845c091b »
2011-08-21 Warn on any right to left (<-) relationship declarations.
62 ### Classes
63
64 * Relationship declarations with the chaining syntax should only be used in
65 the 'left to right' direction.
c4210dfc »
2011-08-22 Check for nested defines and classes
66 * Classes should not be defined inside a class.
67 * Defines should not be defined inside a class.
43aab322 »
2011-08-22 Check for classes that inherit across namespaces
68 * Classes should not inherit between namespaces.
b9b3ca98 »
2011-08-22 Check that required parameters are listed first
69 * Required parameters in class & defined type definitions should be listed
70 before optional parameters.
34b7f42e »
2011-08-22 formatting
71 * When using top-scope variables, including facts, Puppet modules should
1b4df5be »
2011-08-22 Check that all top-scope variables are referenced in the correct name…
72 explicitly specify the empty namespace.
845c091b »
2011-08-21 Warn on any right to left (<-) relationship declarations.
73
e3d32683 »
2011-08-21 Actually put something in README.md
74 ## Reporting bugs or incorrect results
75
76 If you find a bug in puppet-lint or its results, please create an issue in the
77 [repo issues tracker](https://github.com/rodjek/puppet-lint/issues/). Bonus
78 points will be awarded if you also include a patch that fixes the issue.
Something went wrong with that request. Please try again.