puppet-lint-param_comment-check 0.1.7 → 0.1.8

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8c928aed3decd05d2876d4b37ecd564e069317d4b918bf49c36561bac2aa8878
4
- data.tar.gz: 7122d1353312ff519d240c89e9e6e538cc7cd6453451ba8fa8c3cc2a90b86e64
3
+ metadata.gz: 1ecd8b3c79ba841bf497a02bf7c635255479ce777ccd1d74a02938a6aea16e56
4
+ data.tar.gz: 54fd7284713d765083cb0834a3ef42f44e149ebbb8c16753a9251369a96a298a
5
5
  SHA512:
6
- metadata.gz: 883d3841875fb24bc60cdf566a22e917a0a42c9f127739d82c22923eb092b39dbd3e804ec8d6392a04102b9f114142c48f9d98093f24d807c8177f3689b909c5
7
- data.tar.gz: 4d76a9e6d9a79ed2989495a47456a8148661b3363cbf5d6c590e0f5ec028d8156995165f7991b5b21f5305441bdfd3e1d698bbe5c315ea64eeffeb03ef35b32a
6
+ metadata.gz: 6a44d786af696714854f1252d8ec33a40682080becac84e5b3e1f7ab7cf78c7f14022f8096965a7df8c8c8bd841febcb9580f065258943fc45ee6ef7f493933b
7
+ data.tar.gz: 5f2bdc6cc3bd83d359f6b350c703897a3be79edb695ecaaacf44b4afb94cbda7427c0ed536834f45ee5f35f401cd9828b6612660815e16aa70f131105ec0c38f
@@ -3,14 +3,6 @@
3
3
  require_relative '../../puppet-lint-param_comment-check/param_comments'
4
4
  require_relative '../../puppet-lint-param_comment-check/param'
5
5
 
6
- # The empty data of a parameter
7
- EMPTY_PARAM = {
8
- name: '',
9
- type: '',
10
- has_default: false,
11
- default: ''
12
- }.freeze
13
-
14
6
  # Find the header comments for a class or a defined type
15
7
  #
16
8
  # @param tokens The list of all tokens
@@ -85,11 +85,11 @@ class Param
85
85
  @default_tokens = [] unless @in_type && brackets.positive?
86
86
  @in_default = false unless @in_type && brackets.positive?
87
87
  @type_tokens.append(token) if @in_type
88
- when :LBRACE, :LBRACK
88
+ when :LBRACE, :LBRACK, :LPAREN
89
89
  brackets += 1
90
90
  @type_tokens.append(token) if @in_type
91
91
  @default_tokens.append(token) if @in_default
92
- when :RBRACE, :RBRACK
92
+ when :RBRACE, :RBRACK, :RPAREN
93
93
  brackets -= 1
94
94
  @type_tokens.append(token) if @in_type
95
95
  @default_tokens.append(token) if @in_default
@@ -154,6 +154,26 @@ describe 'param_comment' do
154
154
  end
155
155
  end
156
156
 
157
+ context 'valid code with parentheses in the parameters' do
158
+ let(:code) do
159
+ <<~CODE
160
+ # @summary
161
+ # some class
162
+ #
163
+ # @param mandatory
164
+ # A mandatory parameter
165
+ # with two lines
166
+ class my_class (
167
+ String $mandatory = join([0,1,2], ','),
168
+ ) {}
169
+ CODE
170
+ end
171
+
172
+ it 'should not detect any problems' do
173
+ expect(problems).to have(0).problems
174
+ end
175
+ end
176
+
157
177
  context 'code with missing parameter comment' do
158
178
  let(:code) do
159
179
  <<~CODE
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puppet-lint-param_comment-check
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dennis Ploeger