puppet-lint-manifest_whitespace-check 0.1.13 → 0.1.14

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: c6eb78b1b0aa97896074ac01224d0d9ec8d62fd113308cd715c0bb60ff26707c
4
- data.tar.gz: f9c4c73d8a5698e6b3b44732f400a7f3506e9a784622ab8e741332c03f67d2d4
3
+ metadata.gz: 5f942c3097eac960a4830626b7950525074c9c39ab1ff401d04e1256ebda861e
4
+ data.tar.gz: 9aa3c04aa40c1c0f5349044208b717c3c387de7321286c23b53bc3b31169d8c0
5
5
  SHA512:
6
- metadata.gz: 82aeade9ab4d7c4106411ba01250e21c983f78e5d5aa5f53ac8e518f9344be7e219b8182ad6801330e721147d313458bdcbba97882f30170340d9ab5d4250715
7
- data.tar.gz: fbe9b003c323b27e7361f8548e9d234558255fbd7a6229bd863c9f9c2482ef886f787d75455ebad9476127e1d9e08834f73e1467d57468e1af4f28211a68f9cb
6
+ metadata.gz: adb52463b3cc9dee9f8291cf1ef24eb2ecb4e804ac381f7151d7d633bfe2d7c223d385da5ea21b0ceb75921d3d2241ce28a83672554edc74cfdb0b8ff11b1cb1
7
+ data.tar.gz: 3770c9176be5522c65f47d833a34e9430529b327980f0f237d2fa01dc2ddc3dbec0bb8f130110c1711d013e9db50d392c281bed38f351c53aec47e8a3e059977
@@ -25,7 +25,7 @@ PuppetLint.new_check(:manifest_whitespace_closing_brace_before) do
25
25
 
26
26
  notify(
27
27
  :error,
28
- message: 'there should be a bracket or a single newline before a closing brace',
28
+ message: 'there should be a single space or newline before a closing brace',
29
29
  line: prev_code_token.next_token.line,
30
30
  column: prev_code_token.next_token.column,
31
31
  token: prev_code_token.next_token,
@@ -51,7 +51,7 @@ PuppetLint.new_check(:manifest_whitespace_closing_brace_before) do
51
51
  next_token = next_token.next_token
52
52
  end
53
53
 
54
- if next_token.type == :RBRACE && !%i[LBRACE RBRACE RBRACK NEWLINE INDENT].include?(next_token.prev_token.type)
54
+ if next_token.type == :RBRACE && !%i[LBRACE NEWLINE INDENT].include?(next_token.prev_token.type)
55
55
  add_token(tokens.index(next_token), new_single_space)
56
56
  end
57
57
  end
@@ -3,7 +3,37 @@
3
3
  require 'spec_helper'
4
4
 
5
5
  describe 'manifest_whitespace_closing_brace_before' do
6
- let(:closing_brace_msg) { 'there should be a bracket or a single newline before a closing brace' }
6
+ let(:closing_brace_msg) { 'there should be a single space or newline before a closing brace' }
7
+
8
+ context 'with plus' do
9
+ let(:code) do
10
+ <<~EOF
11
+ $my_images = { 'default' => {}}
12
+ EOF
13
+ end
14
+
15
+ context 'with fix enabled' do
16
+ before do
17
+ PuppetLint.configuration.fix = true
18
+ end
19
+
20
+ after do
21
+ PuppetLint.configuration.fix = false
22
+ end
23
+
24
+ it 'should fix a error' do
25
+ expect(problems).to contain_fixed(closing_brace_msg)
26
+ end
27
+
28
+ it 'should add spaces' do
29
+ expect(manifest).to eq(
30
+ <<~EOF,
31
+ $my_images = { 'default' => {} }
32
+ EOF
33
+ )
34
+ end
35
+ end
36
+ end
7
37
 
8
38
  context 'with nested hash' do
9
39
  let(:code) do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puppet-lint-manifest_whitespace-check
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.13
4
+ version: 0.1.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jo Vandeginste