puppet-lint-param-docs 1.7.4 → 1.7.5

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
2
  SHA256:
3
- metadata.gz: a9437e6614a01b679417bbf8df3866b6d7e20ed66fb98192c009af45c167610d
4
- data.tar.gz: f719e9dd7a34e642b24a36ac71b34d8391cec7dd374df5c86fda33604a1340b2
3
+ metadata.gz: 4eb142c68d835142b195284909d9537589ed309072ddaa0a5ba1613422f3588e
4
+ data.tar.gz: 7eb0c3cde4c9772b8d54078de3a7598294545e4de5d4b61509a634d3a4984fae
5
5
  SHA512:
6
- metadata.gz: b89435c384da43d72d3c4bc1b2f7917c63d50f865f1dd002dda3a07093a89947bf84d0a2f2c0294ba9dd1dd1b896b6366d8c847c1bab8b598c02e72acb9e94ed
7
- data.tar.gz: 545d57ef867a96e6fd4b7360dd688461c53537fdab4efcb8e0907771a73d13c5f4b6fc9aa18eda2b8ae02995346784af4d3f8d5658c9018c57bb63023f6b9e64
6
+ metadata.gz: 0fc8365176cd4916883c7e0734a71dab1f38d0a507241df4b2479772127d6293c52c4d236ff21e74fba51e0b2994dcee22f2cad34d617ee1a7df088a34076246
7
+ data.tar.gz: 925331d48264d7787f8874c96db4cdcfb5b2b4f616f7addfacfcdd3a2ee7b8daf05b1886e57adbd17768d6200250a0d136968808c0cde2f24b20294910788ca4
data/README.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # puppet-lint parameter documentation check
2
2
 
3
+ [![License](https://img.shields.io/github/license/voxpupuli/puppet-lint-trailing_comma-check.svg)](https://github.com/voxpupuli/puppet-lint-trailing_comma-check/blob/master/LICENSE)
4
+ [![Test](https://github.com/voxpupuli/puppet-lint-param-docs/actions/workflows/test.yml/badge.svg)](https://github.com/voxpupuli/puppet-lint-param-docs/actions/workflows/test.yml)
5
+ [![codecov](https://codecov.io/gh/voxpupuli/puppet-lint-param-docs/branch/master/graph/badge.svg?token=Mypkl78hvK)](https://codecov.io/gh/voxpupuli/puppet-lint-param-docs)
6
+ [![Release](https://github.com/voxpupuli/puppet-lint-param-docs/actions/workflows/release.yml/badge.svg)](https://github.com/voxpupuli/puppet-lint-param-docs/actions/workflows/release.yml)
7
+ [![RubyGem Version](https://img.shields.io/gem/v/puppet-lint-param-docs.svg)](https://rubygems.org/gems/puppet-lint-param-docs)
8
+ [![RubyGem Downloads](https://img.shields.io/gem/dt/puppet-lint-param-docs.svg)](https://rubygems.org/gems/puppet-lint-param-docs)
9
+ [![Donated by Dominic Cleal](https://img.shields.io/badge/donated%20by-Dominic%20Cleal-fb7047.svg)](#transfer-notice)
10
+
3
11
  Adds a new puppet-lint check to verify all class and defined type parameters
4
12
  have been documented.
5
13
 
@@ -15,6 +23,21 @@ base and run `bundle install`.
15
23
  gem 'puppet-lint-param-docs'
16
24
  ```
17
25
 
26
+ This gem is not only available on rubygems, but also as [GitHub Package](https://github.com/voxpupuli/puppet-lint-param-docs/packages/)
27
+ You can install it from GitHub like this:
28
+
29
+ ```
30
+ $ gem install puppet-lint-param-docs --source "https://rubygems.pkg.github.com/voxpupuli"
31
+ ```
32
+
33
+ Or in a Gemfile:
34
+
35
+ ```
36
+ source "https://rubygems.pkg.github.com/voxpupuli" do
37
+ gem "puppet-lint-param-docs", "1.7.4"
38
+ end
39
+ ```
40
+
18
41
  ## Usage
19
42
 
20
43
  This plugin provides a new check to `puppet-lint`.
@@ -124,3 +147,25 @@ given in `config.pattern`.
124
147
 
125
148
  The [Puppet Strings](#puppet_strings) `@api private` directive can also be used
126
149
  to disable checks on that file.
150
+
151
+ ## Transfer Notice
152
+
153
+ This plugin was originally authored by [Dominic Cleal](https://github.com/domcleal).
154
+ The maintainer preferred that Puppet Community take ownership of the module for future improvement and maintenance.
155
+ Existing pull requests and issues were transferred over, please fork and continue to contribute here.
156
+
157
+ Previously: https://github.com/domcleal/puppet-lint-absolute_classname-check
158
+
159
+ ## License
160
+
161
+ This gem is licensed under the MIT license.
162
+
163
+ ## Release information
164
+
165
+ To make a new release, please do:
166
+ * update the version in the gemspec file
167
+ * Install gems with `bundle install --with release --path .vendor`
168
+ * generate the changelog with `bundle exec rake changelog`
169
+ * Check if the new version matches the closed issues/PRs in the changelog
170
+ * Create a PR with it
171
+ * After it got merged, push a tag. GitHub actions will do the actual release to rubygems and GitHub Packages
@@ -99,9 +99,9 @@ PuppetLint.new_check(:parameter_documentation) do
99
99
  while true
100
100
  ptok = e.next
101
101
  case ptok.type
102
- when :LPAREN
102
+ when :LPAREN, :LBRACK
103
103
  nesting += 1
104
- when :RPAREN
104
+ when :RPAREN, :RBRACK
105
105
  nesting -= 1
106
106
  when :COMMA
107
107
  break unless nesting > 0
@@ -913,4 +913,46 @@ define foreman (
913
913
  expect(problems).to contain_warning('Duplicate defined type parameter documentation for example::name/title').on_line(5).in_column(10)
914
914
  end
915
915
  end
916
+
917
+ context 'class with array defaults containing variables' do
918
+ # Example taken from https://github.com/voxpupuli/puppet-lint-param-docs/issues/30
919
+ let(:code) do
920
+ <<-EOS.gsub(/^\s+/, '')
921
+ # @summary example class
922
+ #
923
+ # @param parameter_1
924
+ # @param parameter_2
925
+ # @param parameter_3
926
+ # @param parameter_4
927
+ # @param parameter_5
928
+ # @param parameter_6
929
+ # @param parameter_7
930
+ # @param parameter_8
931
+ #
932
+ class example (
933
+ Array $parameter_1 = $variable1,
934
+ Array $parameter_2 = [ $variable2, ],
935
+ Array $parameter_3 = [ $variable3, 'string1', ],
936
+ Array $parameter_4 = [
937
+ $variable4,
938
+ 'string1',
939
+ ],
940
+ Array $parameter_5 = [ $variable5, $variable6, 'string1', ],
941
+ Array $parameter_6 = [ $variable7, 'string1', $variable8, ],
942
+ Array $parameter_7 = [ 'string1', $variable9, ],
943
+ Array $parameter_8 = [
944
+ 'string1',
945
+ $variable10,
946
+ 'string2',
947
+ ],
948
+ ) {
949
+ # foo
950
+ }
951
+ EOS
952
+ end
953
+
954
+ it 'should not detect any problems' do
955
+ expect(problems).to have(0).problems
956
+ end
957
+ end
916
958
  end
data/spec/spec_helper.rb CHANGED
@@ -1,3 +1,26 @@
1
+ if ENV['COVERAGE'] == 'yes'
2
+ require 'simplecov'
3
+ require 'simplecov-console'
4
+ require 'codecov'
5
+
6
+ SimpleCov.start do
7
+ track_files 'lib/**/*.rb'
8
+
9
+ add_filter '/spec'
10
+
11
+ enable_coverage :branch
12
+
13
+ # do not track vendored files
14
+ add_filter '/vendor'
15
+ add_filter '/.vendor'
16
+ end
17
+
18
+ SimpleCov.formatters = [
19
+ SimpleCov::Formatter::Console,
20
+ SimpleCov::Formatter::Codecov,
21
+ ]
22
+ end
23
+
1
24
  require 'puppet-lint'
2
25
 
3
26
  PuppetLint::Plugins.load_spec_helper
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.7.4
4
+ version: 1.7.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vox Pupuli
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-06 00:00:00.000000000 Z
11
+ date: 2021-07-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: puppet-lint
@@ -87,7 +87,21 @@ dependencies:
87
87
  - !ruby/object:Gem::Version
88
88
  version: '0'
89
89
  - !ruby/object:Gem::Dependency
90
- name: simplecov
90
+ name: simplecov-console
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
+ - !ruby/object:Gem::Dependency
104
+ name: codecov
91
105
  requirement: !ruby/object:Gem::Requirement
92
106
  requirements:
93
107
  - - ">="
@@ -132,10 +146,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
132
146
  - !ruby/object:Gem::Version
133
147
  version: '0'
134
148
  requirements: []
135
- rubygems_version: 3.1.6
149
+ rubygems_version: 3.2.22
136
150
  signing_key:
137
151
  specification_version: 4
138
152
  summary: puppet-lint check to validate all parameters are documented
139
153
  test_files:
140
- - spec/spec_helper.rb
141
154
  - spec/puppet-lint/plugins/check_parameter_documentation_spec.rb
155
+ - spec/spec_helper.rb