puppet-lint-param-docs 1.7.4 → 1.7.6

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: 26491f65ee561c24b8246bccf4793d451e967aa7b40796a1dfaef59cbf959de4
4
+ data.tar.gz: 74fb61891a78bf720e76ab591ecd18ee4f1ba16b8eb3e57ffac0e7739635d991
5
5
  SHA512:
6
- metadata.gz: b89435c384da43d72d3c4bc1b2f7917c63d50f865f1dd002dda3a07093a89947bf84d0a2f2c0294ba9dd1dd1b896b6366d8c847c1bab8b598c02e72acb9e94ed
7
- data.tar.gz: 545d57ef867a96e6fd4b7360dd688461c53537fdab4efcb8e0907771a73d13c5f4b6fc9aa18eda2b8ae02995346784af4d3f8d5658c9018c57bb63023f6b9e64
6
+ metadata.gz: 58c68e3b29fa294718ba1a43b86f8e9280c039fd94d422abd663f20f340e3fb6eede037b0a8df48553a5b1aaa179b537f82bd5c8499233c53c018e1aa7d5d647
7
+ data.tar.gz: 18ffb5c2dbdba005d56ead040efbdfbd0c5eec3142322338f1641e1847d62491cd71d817b4de67a417d2d1675aba2b3c5366f26867f6fc6734c564cd7733f8cb
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, :LBRACE
103
103
  nesting += 1
104
- when :RPAREN
104
+ when :RPAREN, :RBRACK, :RBRACE
105
105
  nesting -= 1
106
106
  when :COMMA
107
107
  break unless nesting > 0
@@ -913,4 +913,97 @@ 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
958
+
959
+ context 'class with hash defaults containing variables' do
960
+ # Example taken from https://github.com/voxpupuli/puppet-lint-param-docs/issues/49
961
+ let(:code) do
962
+ <<-EOS.gsub(/^\s+/, '')
963
+ # @summary example class
964
+ #
965
+ # @param parameter_1
966
+ # @param parameter_2
967
+ # @param parameter_3
968
+ # @param parameter_4
969
+ # @param parameter_5
970
+ # @param parameter_6
971
+ # @param parameter_7
972
+ # @param parameter_8
973
+ # @param parameter_9
974
+ # @param parameter_10
975
+ # @param parameter_11
976
+ # @param parameter_12
977
+ #
978
+ class example (
979
+ Hash $parameter_1 = $variable1,
980
+ Hash $parameter_2 = { $variable2, },
981
+ Hash $parameter_3 = { $variable3, 'string1', },
982
+ Hash $parameter_4 = {
983
+ $variable4,
984
+ 'string1',
985
+ },
986
+ Hash $parameter_5 = { $variable5, $variable6, 'string1', },
987
+ Hash $parameter_6 = { $variable7, 'string1', $variable8, },
988
+ Hash $parameter_7 = { 'string1', $variable9, },
989
+ Hash $parameter_8 = {
990
+ 'string1',
991
+ $variable10,
992
+ 'string2',
993
+ },
994
+ Hash $parameter_9 = [ { 'string1', $variable11, } ],
995
+ Hash $parameter_10 = [ { 'string1', $variable12, }, { 'string1', $variable13, } ],
996
+ Hash $parameter_11 = { [ 'string1', $variable14, ] },
997
+ Hash $parameter_12 = [ 'string1' => $variable15, 'string2' => $variable16, ],
998
+ ) {
999
+ # foo
1000
+ }
1001
+ EOS
1002
+ end
1003
+
1004
+ it 'should not detect any problems' do
1005
+ puts problems
1006
+ expect(problems).to have(0).problems
1007
+ end
1008
+ end
916
1009
  end
data/spec/spec_helper.rb CHANGED
@@ -1,3 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ begin
4
+ require 'simplecov'
5
+ require 'simplecov-console'
6
+ require 'codecov'
7
+ rescue LoadError
8
+ else
9
+ SimpleCov.start do
10
+ track_files 'lib/**/*.rb'
11
+
12
+ add_filter '/spec'
13
+
14
+ enable_coverage :branch
15
+
16
+ # do not track vendored files
17
+ add_filter '/vendor'
18
+ add_filter '/.vendor'
19
+ end
20
+
21
+ SimpleCov.formatters = [
22
+ SimpleCov::Formatter::Console,
23
+ SimpleCov::Formatter::Codecov,
24
+ ]
25
+ end
26
+
1
27
  require 'puppet-lint'
2
28
 
3
29
  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.6
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: 2022-11-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: puppet-lint
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: '1.1'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '3.0'
22
+ version: '4.0'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: '1.1'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '3.0'
32
+ version: '4.0'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: rspec
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -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.33
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