puppet-lint-param-docs 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +17 -0
- data/lib/puppet-lint-param-docs.rb +1 -0
- data/lib/puppet-lint-param-docs/tasks.rb +40 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fe4696949ca7caeccf27cb18d522a4813218dc4d
|
4
|
+
data.tar.gz: 812dba9986c2cd858376fb452b4d05617fcd5c09
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eca1b30cb791537f7b47695629e3161bb6d584f239054c61eef830b3a3671e28dc4c7e37efcf97f4916d9ee59a38f27cbd240671b31b7902588d88d89a92caf5
|
7
|
+
data.tar.gz: 86641b2086ef5b0eff3dd076fe5ad1d032787394f72b5950896a8b3c87017b075e2477fa32dfb50c61d2e738e2fbf32a4bcd7ece3cfb08899bf4268349362d9a
|
data/README.md
CHANGED
@@ -30,3 +30,20 @@ don't have an RDoc description.
|
|
30
30
|
WARNING: missing documentation for class parameter foo::bar
|
31
31
|
WARNING: missing documentation for defined type parameter foo::baz
|
32
32
|
```
|
33
|
+
|
34
|
+
### Selective rake task
|
35
|
+
|
36
|
+
The usual puppet-lint rake task checks all manifests, which isn't always
|
37
|
+
desirable with this particular check. If your module contains many classes,
|
38
|
+
some of which you don't wish to document, then you can exclude them using
|
39
|
+
[control comments](http://puppet-lint.com/controlcomments/) or by using this
|
40
|
+
helper to customise the lint rake task:
|
41
|
+
|
42
|
+
require 'puppet-lint-param-docs/tasks'
|
43
|
+
PuppetLintParamDocs.define_selective do |config|
|
44
|
+
config.pattern = ['manifests/init.pp', 'manifests/other/**/*.pp']
|
45
|
+
end
|
46
|
+
|
47
|
+
This would disable the parameter_documentation check by default, but then
|
48
|
+
defines a new rake task (which runs after `lint`) specifically for the files
|
49
|
+
given in `config.pattern`.
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'puppet-lint-param-docs/tasks'
|
@@ -0,0 +1,40 @@
|
|
1
|
+
module PuppetLintParamDocs
|
2
|
+
# A helper to define a more specific rake task that runs after the
|
3
|
+
# usual 'lint' task, but only with param docs checks. It disables
|
4
|
+
# the param docs checks in the main lint task.
|
5
|
+
#
|
6
|
+
# Allows users to define a more restrictive pattern for param docs
|
7
|
+
# checks.
|
8
|
+
def self.define_selective(&task_block)
|
9
|
+
RakeTask.new.define_selective(&task_block)
|
10
|
+
end
|
11
|
+
|
12
|
+
class RakeTask < ::Rake::TaskLib
|
13
|
+
include ::Rake::DSL if defined?(::Rake::DSL)
|
14
|
+
|
15
|
+
def define_selective(&task_block)
|
16
|
+
PuppetLint::RakeTask.new(:lint_param_docs) do |config|
|
17
|
+
config.fail_on_warnings = true
|
18
|
+
config.disable_checks = (PuppetLint.configuration.checks - [:parameter_documentation])
|
19
|
+
yield config
|
20
|
+
end
|
21
|
+
|
22
|
+
# Explicitly enable check as "lint" task will disable it
|
23
|
+
task :lint_param_docs_enable do
|
24
|
+
PuppetLint.configuration.enable_parameter_documentation
|
25
|
+
end
|
26
|
+
Rake::Task[:lint_param_docs].enhance [:lint_param_docs_enable]
|
27
|
+
|
28
|
+
# Explicitly disable param doc in general lint task
|
29
|
+
task :lint_param_docs_disable do
|
30
|
+
PuppetLint.configuration.disable_parameter_documentation
|
31
|
+
end
|
32
|
+
Rake::Task[:lint].enhance [:lint_param_docs_disable]
|
33
|
+
|
34
|
+
# Run param docs lint after main lint
|
35
|
+
Rake::Task[:lint].enhance do
|
36
|
+
Rake::Task[:lint_param_docs].invoke
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puppet-lint-param-docs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dominic Cleal
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-07-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: puppet-lint
|
@@ -89,6 +89,8 @@ extra_rdoc_files: []
|
|
89
89
|
files:
|
90
90
|
- LICENSE
|
91
91
|
- README.md
|
92
|
+
- lib/puppet-lint-param-docs.rb
|
93
|
+
- lib/puppet-lint-param-docs/tasks.rb
|
92
94
|
- lib/puppet-lint/plugins/check_parameter_documentation.rb
|
93
95
|
- spec/puppet-lint/plugins/check_parameter_documentation_spec.rb
|
94
96
|
- spec/spec_helper.rb
|