puppet-lint-manifest_whitespace-check 0.2.4 → 0.2.5

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: 1a7733009c47320dbae135031b97cd389cd2edab33095ef5a9c64d2b61375d8c
4
- data.tar.gz: 5e356c323847a31282c948131d41cd6c9b4f40338818bf42f46b65d3320694b1
3
+ metadata.gz: c3fe61412435fe6e35447e02c54fe9b71937f5b1ceb30c65308eb8e1b61adaf0
4
+ data.tar.gz: d50c16634bb1f6609b5029b163a615d21e26e49df289be506634ee2f5240c205
5
5
  SHA512:
6
- metadata.gz: a8621832c8cf644f7ad467a1215d944ce2427ad97c127f2b60521bd6e6f743f9d37265a030dc11e9491455ab4ce50bab6db6cef1de0417d058c28fa8731fb110
7
- data.tar.gz: 7bd64637bf4bde4a1e71c9dd50534a69a63bb698bda7097f68de2759da4bcd8e0b8f7146686c5dc6e38bd539a8e31c1c67708229127e3f4ea448dbbc80bc198e
6
+ metadata.gz: db462d214af83d3f3f32ae1d4aa91aad45c32d7c1ead916bc459cc56e1d345c258d4e28c3a5d48b2c13b890f7fa4a929177c3b91c3ce08d15a3618467c0d4a10
7
+ data.tar.gz: 2d57e6f697d41bf685bbc8b403fa11a2408c0aae3995b462f3f7f700c29ebc840a236767e841dce0c37233bd124227e3eec2f047c95ca1150caf7603d1072c79
@@ -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
4
+ version: 0.2.5
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-10 00:00:00.000000000 Z
11
+ date: 2022-10-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: puppet-lint