puppet-lint-trailing_comma-check 0.1.0 → 0.1.1

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
  SHA1:
3
- metadata.gz: 38a1fd04aeaf11684d22adcb4306059667f41f3b
4
- data.tar.gz: 8a8c5893f796a65d18dd266dd421aa42fad82dde
3
+ metadata.gz: 1ec20840a523a7403ecaeba4757f9b74554fa0f6
4
+ data.tar.gz: 5358c21db4b26f7fb842099e391f2a780e1399b0
5
5
  SHA512:
6
- metadata.gz: 25749255ed6f56079cba85f26467768181c18716b8f3bc3583074f6f4c7f89f36ecee19cbf7373c054ca83d3fcc7ada2d2e785c3f78ad932498951c35973993e
7
- data.tar.gz: d2930af4df68ea936200a1f7cc956bc95a28e48f986f107d0cd0466cc4f6ab04226d449aeb20c1b27207d74a4d1ce6254fae398834c7ef333454b45f18ac1024
6
+ metadata.gz: c4f1de378fd31e18f4326f191cd136d728f1e57a19d6e42eed51920138dfc2a3503c1c6aa57e412938f7ceea49fd1cf61b250e42fa1a9f50ac8e7a7436ae3534
7
+ data.tar.gz: 5e6542eb7c3601659e8657bfc8284402ea48a4c92160ae579e53ec9679d1212f99b072845de8621d87a73ceaf6f81abdaecfa71ad22a6cfef985d28e8598d187
@@ -3,7 +3,7 @@ PuppetLint.new_check(:trailing_comma) do
3
3
  # Resource and class declarations
4
4
  resource_indexes.each do |resource|
5
5
  lbo_token = resource[:tokens][-1].prev_code_token
6
- if lbo_token && lbo_token.type != :COMMA
6
+ if lbo_token && lbo_token.type != :COLON && lbo_token.type != :COMMA
7
7
  notify :warning, {
8
8
  :message => 'missing trailing comma after last parameter',
9
9
  :line => lbo_token.next_token.line,
@@ -12,10 +12,14 @@ describe 'trailing_comma' do
12
12
  docroot => '/var/www',
13
13
  }
14
14
 
15
+ class{ '::nginx': }
16
+
15
17
  file { '/etc/fstab':
16
18
  ensure => 'file',
17
19
  content => 'foo',
18
20
  }
21
+
22
+ file { '/tmp/foo': }
19
23
  EOS
20
24
  }
21
25
 
@@ -32,10 +36,14 @@ describe 'trailing_comma' do
32
36
  docroot => '/var/www'
33
37
  }
34
38
 
39
+ class{ '::nginx': }
40
+
35
41
  file { '/etc/fstab':
36
42
  ensure => 'file',
37
43
  content => 'foo'
38
44
  }
45
+
46
+ file { '/tmp/foo': }
39
47
  EOS
40
48
  }
41
49
 
@@ -45,7 +53,7 @@ describe 'trailing_comma' do
45
53
 
46
54
  it 'should create a warning' do
47
55
  expect(problems).to contain_warning(msg).on_line(3).in_column(32)
48
- expect(problems).to contain_warning(msg).on_line(8).in_column(27)
56
+ expect(problems).to contain_warning(msg).on_line(10).in_column(27)
49
57
  end
50
58
  end
51
59
  end
@@ -67,10 +75,14 @@ describe 'trailing_comma' do
67
75
  docroot => '/var/www',
68
76
  }
69
77
 
78
+ class{ '::nginx': }
79
+
70
80
  file { '/etc/fstab':
71
81
  ensure => 'file',
72
82
  content => 'foo',
73
83
  }
84
+
85
+ file { '/tmp/foo': }
74
86
  EOS
75
87
  }
76
88
 
@@ -91,10 +103,14 @@ describe 'trailing_comma' do
91
103
  docroot => '/var/www'
92
104
  }
93
105
 
106
+ class{ '::nginx': }
107
+
94
108
  file { '/etc/fstab':
95
109
  ensure => 'file',
96
110
  content => 'foo'
97
111
  }
112
+
113
+ file { '/tmp/foo': }
98
114
  EOS
99
115
  }
100
116
 
@@ -104,7 +120,7 @@ describe 'trailing_comma' do
104
120
 
105
121
  it 'should create a warning' do
106
122
  expect(problems).to contain_fixed(msg).on_line(3).in_column(32)
107
- expect(problems).to contain_fixed(msg).on_line(8).in_column(27)
123
+ expect(problems).to contain_fixed(msg).on_line(10).in_column(27)
108
124
  end
109
125
 
110
126
  it 'should add trailing commas' do
@@ -115,10 +131,14 @@ describe 'trailing_comma' do
115
131
  docroot => '/var/www',
116
132
  }
117
133
 
134
+ class{ '::nginx': }
135
+
118
136
  file { '/etc/fstab':
119
137
  ensure => 'file',
120
138
  content => 'foo',
121
139
  }
140
+
141
+ file { '/tmp/foo': }
122
142
  EOS
123
143
  )
124
144
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puppet-lint-trailing_comma-check
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Camptocamp