puppet-lint-trailing_comma-check 0.4.2 → 0.4.3

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: 88f6254b5b943d5d1db6f192ee09f985f9415d5633646fe8a5d078e608a6c12f
4
- data.tar.gz: d44381bacafa7ffd15724c85d6e7000a96cad1c5d1e5e6f6638f9bad5a81dadd
3
+ metadata.gz: e41a473856855e19fc39972572b59cac85c269c727bd8039f336d99f6a33e26f
4
+ data.tar.gz: f52de49ea2fcc778284152f288c30f2496eea22a1b8b795950a6e462d738fbf7
5
5
  SHA512:
6
- metadata.gz: 421c4cfe94c27a82569a88b4e9b709b259e32c9a4b772128d33744c2230704e9da975f4e130429eb3675075ed0b51ecf9b77e905122dc77c9e171c07f07a78f8
7
- data.tar.gz: e5e0c305b05742384e0b2ff06976ef97b0bb5c1be079e9b69dc98da85e357e98ffb7e03a212dee2ec256b7e569c419116a1b5ad8158c626cca09eef50849542a
6
+ metadata.gz: 5e8e7368247209d0c36040c0fb95c74cbe6a9779397b75dc3800ef95c7de9532ff7bfa42543f6e3f3b44d573600e4ff2a40ff44ba04f5eee3be30fb69d43adcc
7
+ data.tar.gz: 46cffcde63d6f3d46230c0fad39764eb062fe09d125636c94a0ef3be911cf83bc465125459ee0f64d7a2996d6a9e18c5fb581a7864aa3115b188ecc1a56c7365
data/README.md CHANGED
@@ -2,11 +2,11 @@ puppet-lint-trailing_comma-check
2
2
  =================================
3
3
 
4
4
  [![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)
5
- [![Build Status](https://img.shields.io/travis/voxpupuli/puppet-lint-trailing_comma-check.svg)](https://travis-ci.org/voxpupuli/puppet-lint-trailing_comma-check)
6
- [![Gem Version](https://img.shields.io/gem/v/puppet-lint-trailing_comma-check.svg)](https://rubygems.org/gems/puppet-lint-trailing_comma-check)
7
- [![Gem Downloads](https://img.shields.io/gem/dt/puppet-lint-trailing_comma-check.svg)](https://rubygems.org/gems/puppet-lint-trailing_comma-check)
5
+ [![Test](https://github.com/voxpupuli/puppet-lint-trailing_comma-check/actions/workflows/test.yml/badge.svg)](https://github.com/voxpupuli/puppet-lint-trailing_comma-check/actions/workflows/test.yml)
6
+ [![Release](https://github.com/voxpupuli/puppet-lint-trailing_comma-check/actions/workflows/release.yml/badge.svg)](https://github.com/voxpupuli/puppet-lint-trailing_comma-check/actions/workflows/release.yml)
7
+ [![RubyGem Version](https://img.shields.io/gem/v/puppet-lint-trailing_comma-check.svg)](https://rubygems.org/gems/puppet-lint-trailing_comma-check)
8
+ [![RubyGem Downloads](https://img.shields.io/gem/dt/puppet-lint-trailing_comma-check.svg)](https://rubygems.org/gems/puppet-lint-trailing_comma-check)
8
9
  [![Coverage Status](https://coveralls.io/repos/github/voxpupuli/puppet-lint-trailing_comma-check/badge.svg?branch=master)](https://coveralls.io/github/voxpupuli/puppet-lint-trailing_comma-check?branch=master)
9
- [![Dependency Status](https://gemnasium.com/badges/github.com/voxpupuli/puppet-lint-trailing_comma-check.svg)](https://gemnasium.com/github.com/voxpupuli/puppet-lint-trailing_comma-check)
10
10
  [![Donated by Camptocamp](https://img.shields.io/badge/donated%20by-camptocamp-fb7047.svg)](#transfer-notice)
11
11
 
12
12
  A puppet-lint plugin to check for missing trailing commas.
@@ -70,3 +70,17 @@ The maintainer preferred that Puppet Community take ownership of the module for
70
70
  Existing pull requests and issues were transferred over, please fork and continue to contribute here instead of Camptocamp.
71
71
 
72
72
  Previously: https://github.com/camptocamp/puppet-lint-trailing_comma-check
73
+
74
+ ## License
75
+
76
+ This gem is licensed under the Apache-2 license.
77
+
78
+ ## Release information
79
+
80
+ To make a new release, please do:
81
+ * update the version in the gemspec file
82
+ * Install gems with `bundle install --with release --path .vendor`
83
+ * generate the changelog with `bundle exec rake changelog`
84
+ * Check if the new version matches the closed issues/PRs in the changelog
85
+ * Create a PR with it
86
+ * After it got merged, push a tag. GitHub actions will do the actual release to rubygems and GitHub Packages
@@ -13,6 +13,11 @@ PuppetLint.new_check(:trailing_comma) do
13
13
  # Ignore resource references
14
14
  next if token.prev_code_token && \
15
15
  token.prev_code_token.type == :CLASSREF
16
+
17
+ # Ignore data types
18
+ next if token.prev_code_token && \
19
+ token.prev_code_token.type == :TYPE
20
+
16
21
  arrays << {
17
22
  :start => token_idx,
18
23
  :end => real_idx,
@@ -10,6 +10,11 @@ describe 'trailing_comma' do
10
10
  class { '::apache':
11
11
  timeout => '100',
12
12
  docroot => '/var/www',
13
+ Enum[
14
+ 'a',
15
+ 'b',
16
+ 'c'
17
+ ] $test = 'c',
13
18
  }
14
19
 
15
20
  class{ '::nginx': }
@@ -70,6 +75,12 @@ describe 'trailing_comma' do
70
75
  if $var !~ Mymodule::MyType {
71
76
  fail("encountered error ${err}")
72
77
  }
78
+
79
+ $test = [
80
+ 'a',
81
+ 'b',
82
+ 'c',
83
+ ],
73
84
  EOS
74
85
  }
75
86
 
@@ -83,7 +94,12 @@ describe 'trailing_comma' do
83
94
  <<-EOS
84
95
  class { '::apache':
85
96
  timeout => '100',
86
- docroot => '/var/www'
97
+ docroot => '/var/www',
98
+ Enum[
99
+ 'a',
100
+ 'b',
101
+ 'c'
102
+ ] $test = 'c'
87
103
  }
88
104
 
89
105
  class{ '::nginx': }
@@ -129,20 +145,27 @@ describe 'trailing_comma' do
129
145
  '/etc/baz.conf', '/etc/baz.conf.d'
130
146
  ],
131
147
  }
148
+
149
+ $test = [
150
+ 'a',
151
+ 'b',
152
+ 'c'
153
+ ]
132
154
  EOS
133
155
  }
134
156
 
135
- it 'should detect 6 problems' do
136
- expect(problems).to have(6).problems
157
+ it 'should detect 7 problems' do
158
+ expect(problems).to have(7).problems
137
159
  end
138
160
 
139
161
  it 'should create warnings' do
140
- expect(problems).to contain_warning(msg).on_line(3).in_column(32)
141
- expect(problems).to contain_warning(msg).on_line(10).in_column(27)
142
- expect(problems).to contain_warning(msg).on_line(24).in_column(18)
143
- expect(problems).to contain_warning(msg).on_line(33).in_column(23)
144
- expect(problems).to contain_warning(msg).on_line(39).in_column(26)
145
- expect(problems).to contain_warning(msg).on_line(41).in_column(25)
162
+ expect(problems).to contain_warning(msg).on_line(8).in_column(24)
163
+ expect(problems).to contain_warning(msg).on_line(15).in_column(27)
164
+ expect(problems).to contain_warning(msg).on_line(29).in_column(18)
165
+ expect(problems).to contain_warning(msg).on_line(38).in_column(23)
166
+ expect(problems).to contain_warning(msg).on_line(44).in_column(26)
167
+ expect(problems).to contain_warning(msg).on_line(46).in_column(25)
168
+ expect(problems).to contain_warning(msg).on_line(58).in_column(14)
146
169
  end
147
170
  end
148
171
 
@@ -223,6 +246,11 @@ describe 'trailing_comma' do
223
246
  class { '::apache':
224
247
  timeout => '100',
225
248
  docroot => '/var/www',
249
+ Enum[
250
+ 'a',
251
+ 'b',
252
+ 'c'
253
+ ] $test = 'c',
226
254
  }
227
255
 
228
256
  class{ '::nginx': }
@@ -268,6 +296,12 @@ describe 'trailing_comma' do
268
296
  '/etc/baz.conf', '/etc/baz.conf.d'
269
297
  ],
270
298
  }
299
+
300
+ $test = [
301
+ 'a',
302
+ 'b',
303
+ 'c',
304
+ ],
271
305
  EOS
272
306
  }
273
307
 
@@ -285,7 +319,12 @@ describe 'trailing_comma' do
285
319
  <<-EOS
286
320
  class { '::apache':
287
321
  timeout => '100',
288
- docroot => '/var/www'
322
+ docroot => '/var/www',
323
+ Enum[
324
+ 'a',
325
+ 'b',
326
+ 'c'
327
+ ] $test = 'c'
289
328
  }
290
329
 
291
330
  class{ '::nginx': }
@@ -331,20 +370,27 @@ describe 'trailing_comma' do
331
370
  '/etc/baz.conf', '/etc/baz.conf.d'
332
371
  ],
333
372
  }
373
+
374
+ $test = [
375
+ 'a',
376
+ 'b',
377
+ 'c'
378
+ ]
334
379
  EOS
335
380
  }
336
381
 
337
- it 'should detect 6 problems' do
338
- expect(problems).to have(6).problems
382
+ it 'should detect 7 problems' do
383
+ expect(problems).to have(7).problems
339
384
  end
340
385
 
341
386
  it 'should create a warning' do
342
- expect(problems).to contain_fixed(msg).on_line(3).in_column(32)
343
- expect(problems).to contain_fixed(msg).on_line(10).in_column(27)
344
- expect(problems).to contain_fixed(msg).on_line(24).in_column(18)
345
- expect(problems).to contain_fixed(msg).on_line(33).in_column(23)
346
- expect(problems).to contain_fixed(msg).on_line(39).in_column(26)
347
- expect(problems).to contain_fixed(msg).on_line(41).in_column(25)
387
+ expect(problems).to contain_fixed(msg).on_line(8).in_column(24)
388
+ expect(problems).to contain_fixed(msg).on_line(15).in_column(27)
389
+ expect(problems).to contain_fixed(msg).on_line(29).in_column(18)
390
+ expect(problems).to contain_fixed(msg).on_line(38).in_column(23)
391
+ expect(problems).to contain_fixed(msg).on_line(44).in_column(26)
392
+ expect(problems).to contain_fixed(msg).on_line(46).in_column(25)
393
+ expect(problems).to contain_fixed(msg).on_line(58).in_column(14)
348
394
  end
349
395
 
350
396
  it 'should add trailing commas' do
@@ -353,6 +399,11 @@ describe 'trailing_comma' do
353
399
  class { '::apache':
354
400
  timeout => '100',
355
401
  docroot => '/var/www',
402
+ Enum[
403
+ 'a',
404
+ 'b',
405
+ 'c'
406
+ ] $test = 'c',
356
407
  }
357
408
 
358
409
  class{ '::nginx': }
@@ -398,7 +449,13 @@ describe 'trailing_comma' do
398
449
  '/etc/baz.conf', '/etc/baz.conf.d'
399
450
  ],
400
451
  }
401
- EOS
452
+
453
+ $test = [
454
+ 'a',
455
+ 'b',
456
+ 'c',
457
+ ]
458
+ EOS
402
459
  )
403
460
  end
404
461
  end
data/spec/spec_helper.rb CHANGED
@@ -1,5 +1,28 @@
1
- require 'coveralls'
2
- Coveralls.wear!
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
3
26
 
4
27
  require 'puppet-lint'
5
28
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puppet-lint-trailing_comma-check
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
- - Puppet Community
7
+ - Vox Pupuli
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-12-06 00:00:00.000000000 Z
11
+ date: 2022-10-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: puppet-lint
@@ -73,21 +73,7 @@ dependencies:
73
73
  - !ruby/object:Gem::Version
74
74
  version: '1.0'
75
75
  - !ruby/object:Gem::Dependency
76
- name: mime-types
77
- requirement: !ruby/object:Gem::Requirement
78
- requirements:
79
- - - ">="
80
- - !ruby/object:Gem::Version
81
- version: '0'
82
- type: :development
83
- prerelease: false
84
- version_requirements: !ruby/object:Gem::Requirement
85
- requirements:
86
- - - ">="
87
- - !ruby/object:Gem::Version
88
- version: '0'
89
- - !ruby/object:Gem::Dependency
90
- name: coveralls
76
+ name: simplecov
91
77
  requirement: !ruby/object:Gem::Requirement
92
78
  requirements:
93
79
  - - ">="
@@ -115,7 +101,7 @@ dependencies:
115
101
  - !ruby/object:Gem::Version
116
102
  version: '0'
117
103
  description: " A puppet-lint plugin to check for missing trailing commas.\n"
118
- email: raphael.pinson@camptocamp.com
104
+ email: voxpupuli@groups.io
119
105
  executables: []
120
106
  extensions: []
121
107
  extra_rdoc_files: []
@@ -144,11 +130,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
144
130
  - !ruby/object:Gem::Version
145
131
  version: '0'
146
132
  requirements: []
147
- rubyforge_project:
148
- rubygems_version: 2.7.8
133
+ rubygems_version: 3.2.33
149
134
  signing_key:
150
135
  specification_version: 4
151
136
  summary: A puppet-lint plugin to check for missing trailing commas.
152
137
  test_files:
153
- - spec/spec_helper.rb
154
138
  - spec/puppet-lint/plugins/check_trailing_comma/check_trailing_comma_spec.rb
139
+ - spec/spec_helper.rb