puppet-lint-trailing_comma-check 0.1.0 → 0.1.1
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1ec20840a523a7403ecaeba4757f9b74554fa0f6
|
4
|
+
data.tar.gz: 5358c21db4b26f7fb842099e391f2a780e1399b0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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(
|
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(
|
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
|