puppet-lint-manifest_whitespace-check 0.2.4 → 0.2.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bfd370ff80d1f947b2ff60f2328ec106465b4dbc6aa43b3e9b90d029cc217912
|
4
|
+
data.tar.gz: 03ad9c1bbc4c4620a82201068606984ea7229165af7bd00572920ae5af0c4316
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: deec8f90369d519039c09c721087c289dd9c4c7225c2caa760b21cdaeacd4611f7b95470a2c3c2732fdd3e045f78d872ac8f8935d200e2a48b9e578bac4f0745
|
7
|
+
data.tar.gz: 0b008268fd5686720c5e9d4173e78543f741dc8a41a7f9b97d2656cb4eae52a9b9b897fe07b59464d6f542a9f485bb9fdeaa5707e1650a21eb13f674467e9f4b
|
@@ -4,7 +4,7 @@ PuppetLint.new_check(:manifest_whitespace_missing_newline_end_of_file) do
|
|
4
4
|
def check
|
5
5
|
last_token = tokens.last
|
6
6
|
|
7
|
-
if last_token.type != :NEWLINE
|
7
|
+
if last_token && last_token.type != :NEWLINE
|
8
8
|
notify(
|
9
9
|
:error,
|
10
10
|
message: 'there should be a single newline at the end of a manifest',
|
@@ -25,7 +25,7 @@ PuppetLint.new_check(:manifest_whitespace_double_newline_end_of_file) do
|
|
25
25
|
def check
|
26
26
|
last_token = tokens.last
|
27
27
|
|
28
|
-
if last_token.type == :NEWLINE
|
28
|
+
if last_token && last_token.type == :NEWLINE
|
29
29
|
while last_token.prev_token && last_token.prev_token.type == :NEWLINE
|
30
30
|
notify(
|
31
31
|
:error,
|
@@ -4,12 +4,14 @@ PuppetLint.new_check(:manifest_whitespace_opening_bracket_before) do
|
|
4
4
|
def check
|
5
5
|
tokens.select { |token| token.type == :LBRACK }.each do |bracket_token|
|
6
6
|
prev_token = bracket_token.prev_token
|
7
|
+
|
8
|
+
next if %i[CLASSREF VARIABLE NAME].include?(prev_token.type)
|
9
|
+
|
7
10
|
prev_code_token = prev_non_space_token(bracket_token)
|
8
11
|
|
9
12
|
next if %i[SEMIC COMMA COLON].include?(prev_code_token.type) && %i[INDENT NEWLINE].include?(prev_token.type)
|
10
13
|
next if %i[COMMENT].include?(prev_code_token.type)
|
11
14
|
next if %i[INDENT NEWLINE].include?(prev_token.type) && %i[NAME RBRACK RBRACE].include?(prev_code_token.type)
|
12
|
-
next if %i[CLASSREF VARIABLE].include?(prev_code_token.type) && (prev_code_token == prev_token)
|
13
15
|
|
14
16
|
if %i[RBRACK RBRACE RPAREN LPAREN LBRACK LBRACE TYPE].include?(prev_code_token.type)
|
15
17
|
next if prev_code_token == prev_token
|
@@ -78,7 +78,16 @@ describe 'manifest_whitespace_opening_bracket_before' do
|
|
78
78
|
class example (
|
79
79
|
String $content,
|
80
80
|
Optional[String] $some_other_content,
|
81
|
+
Array $var = lookup('foo::bar', Array, undef, [])
|
81
82
|
) {
|
83
|
+
if $fact["${var}"] != $var2.keys[0] {
|
84
|
+
# noop
|
85
|
+
}
|
86
|
+
|
87
|
+
if fact["${var}"] != $var2.keys[0] {
|
88
|
+
# noop
|
89
|
+
}
|
90
|
+
|
82
91
|
$value = [{ 'key' => 'value' }]
|
83
92
|
$value2 = [
|
84
93
|
{
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puppet-lint-manifest_whitespace-check
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jo Vandeginste
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-10-
|
11
|
+
date: 2022-10-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: puppet-lint
|