puppet-lint-param-docs 1.4.2 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 97c4532b41c68c3cce6c7566a28900e66e90dc70
4
- data.tar.gz: c5ee842a8e1f28935b51a9ab6ce5bcf0ec007f41
2
+ SHA256:
3
+ metadata.gz: 8f8b9401c298a02b66324e5ef2db75b5e1e498d19a0a64e0e4d05208003da40b
4
+ data.tar.gz: 0ddfcd5cf79cbd88e60b59c5645e636e60092efcf305fe5c71ecc73d3580ca84
5
5
  SHA512:
6
- metadata.gz: cb9ae66d054669c78ff450c5efb0856e40238dca4335274069d4a3d70f078e7839d5a095cda3640a5abd0762180cacdcf6c87b7f21e3c36b57136796cab75981
7
- data.tar.gz: 6dc412254ab70459f4ee0cb49b71f128f76e7710b154bb4930525bf8e36a47e8177211aabdcf091d5389ec9e697f268e9cc70641c99ac11ccf3e02a8ed27f83f
6
+ metadata.gz: 50e90eccc7fd99371a2d59d125b0e6483f2b0a2b002f018339d81320aee9b44b89627b5c1178e710341c8cb2ca31d4893bda414e53a0b5b2530d83476726676f
7
+ data.tar.gz: c1038644ed09895de383ed28d87e5041afd3fd7efc665f3dabf58c53aa89f9b2fc51f54e9ae5d35b725b71ac75d8fea1c1bc84c47b6610cfe7bb48c0639ed198
data/README.md CHANGED
@@ -86,3 +86,6 @@ helper to customise the lint rake task:
86
86
  This would disable the parameter_documentation check by default, but then
87
87
  defines a new rake task (which runs after `lint`) specifically for the files
88
88
  given in `config.pattern`.
89
+
90
+ The [Puppet Strings](#puppet_strings) `@api private` directive can also be used
91
+ to disable checks on that file.
@@ -4,6 +4,7 @@ PuppetLint.new_check(:parameter_documentation) do
4
4
  next if idx[:param_tokens].nil?
5
5
 
6
6
  doc_params = []
7
+ is_private = false
7
8
  tokens[0..idx[:start]].reverse_each do |dtok|
8
9
  next if [:CLASS, :DEFINE, :NEWLINE, :WHITESPACE, :INDENT].include?(dtok.type)
9
10
  if [:COMMENT, :MLCOMMENT, :SLASH_COMMENT].include?(dtok.type)
@@ -12,11 +13,15 @@ PuppetLint.new_check(:parameter_documentation) do
12
13
  dtok.value =~ /\A\s*@param (?:\[.+\] )?([a-zA-Z0-9_]+)(?: +|$)/
13
14
  doc_params << $1
14
15
  end
16
+
17
+ is_private = true if dtok.value =~ /\A\s*@api +private\s*$/
15
18
  else
16
19
  break
17
20
  end
18
21
  end
19
22
 
23
+ next if is_private
24
+
20
25
  params = []
21
26
  e = idx[:param_tokens].each
22
27
  begin
@@ -149,6 +149,27 @@ define foreman (
149
149
  end
150
150
  end
151
151
 
152
+ context 'private class missing documentation (@param bar) for a parameter' do
153
+ let(:code) do
154
+ <<-EOS.gsub(/^\s+/, '')
155
+ # Example class
156
+ #
157
+ # @api private
158
+ #
159
+ # @param bar example
160
+ class example($foo, $bar) { }
161
+ EOS
162
+ end
163
+
164
+ it 'should detect no single problems' do
165
+ expect(problems).to have(0).problems
166
+ end
167
+
168
+ it 'should not create a warning' do
169
+ expect(problems).not_to contain_info(class_msg % :foo)
170
+ end
171
+ end
172
+
152
173
  context 'define missing documentation (@param bar) for a parameter' do
153
174
  let(:code) do
154
175
  <<-EOS.gsub(/^\s+/, '')
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.2
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vox Pupuli
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-29 00:00:00.000000000 Z
11
+ date: 2019-01-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: puppet-lint
@@ -86,8 +86,21 @@ dependencies:
86
86
  - - ">="
87
87
  - !ruby/object:Gem::Version
88
88
  version: '0'
89
- description: |2
90
- A new check for puppet-lint that validates all parameters are documented.
89
+ - !ruby/object:Gem::Dependency
90
+ name: simplecov
91
+ requirement: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - ">="
94
+ - !ruby/object:Gem::Version
95
+ version: '0'
96
+ type: :development
97
+ prerelease: false
98
+ version_requirements: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - ">="
101
+ - !ruby/object:Gem::Version
102
+ version: '0'
103
+ description: " A new check for puppet-lint that validates all parameters are documented.\n"
91
104
  email: voxpupuli@groups.io
92
105
  executables: []
93
106
  extensions: []
@@ -119,11 +132,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
119
132
  - !ruby/object:Gem::Version
120
133
  version: '0'
121
134
  requirements: []
122
- rubyforge_project:
123
- rubygems_version: 2.4.5
135
+ rubygems_version: 3.0.2
124
136
  signing_key:
125
137
  specification_version: 4
126
138
  summary: puppet-lint check to validate all parameters are documented
127
139
  test_files:
128
- - spec/puppet-lint/plugins/check_parameter_documentation_spec.rb
129
140
  - spec/spec_helper.rb
141
+ - spec/puppet-lint/plugins/check_parameter_documentation_spec.rb