puppet-lint-strict_indent-check 2.0.6 → 2.0.7

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: 804d6abcaf4f2a4901a92c870bc3757ef41686d03a69cc8b8d12e79ac1314ee8
4
- data.tar.gz: 12f31bfa8b97c32a9672b21070d18fa1e17e4b6a5f52ce3fc9c906ef694dda96
3
+ metadata.gz: 30d1f1221da833545ef923f5293f8a83da0bcec09cf3b8f82ef3987ebf31db00
4
+ data.tar.gz: 74d0270b7cec272827b742a208d22c629ede699b9a459088146dc77d15422c45
5
5
  SHA512:
6
- metadata.gz: f2597a26fe5b2d90e1f734fb4bd1a01f5c9521b751b2afe37b354103e8f186f4ee8b8c031642e6e825316e523229ea6d659581253a968a1419608496b07347fa
7
- data.tar.gz: a90981494f25f52346791744c7e29adf56a1f44f42508a7cfb71c85c67830c9d395fca8cf49715c479bdf60d38cf2b3cfc07f8b7884f92f1c3e7d2fd1426480c
6
+ metadata.gz: 9ae0feb16096446d4601faa0d1b073d6fb01352c698a9ee4092274a6655a22bb24d03fcc66fb1f152dba287bb405c2af194315257b00a6445f45f6dcd3552608
7
+ data.tar.gz: 5d2a3a7c7ed96b1783954c33023cc9aa0beb06a447f4fef9eae3ecd19308099d37858f19452e41667bc3aa52ab063e930be9410c31d39016476191d7c470d8d9
@@ -131,9 +131,9 @@ PuppetLint.new_check(:'strict_indent') do
131
131
  actual = 0
132
132
  if token.next_token.type == :INDENT
133
133
  actual = token.next_token.value.length
134
- elsif token.prev_token.type == :HEREDOC
134
+ elsif !token.prev_token.nil? and token.prev_token.type == :HEREDOC
135
135
  actual = token.prev_token.value.split("\n").last.length
136
- elsif token.prev_token.type == :HEREDOC_OPEN
136
+ elsif !token.prev_token.nil? and token.prev_token.type == :HEREDOC_OPEN
137
137
  actual = next_token.prev_token.value.split("\n").last.length
138
138
  else
139
139
  actual = 0
@@ -77,4 +77,17 @@ describe 'strict_indent' do
77
77
  expect(problems).to have(1).problems
78
78
  end
79
79
  end
80
+
81
+ context 'blank line at beginning of file' do
82
+ let(:code) {
83
+ <<-EOF.gsub(/^ {8}/, '')
84
+
85
+ class () {}
86
+ EOF
87
+ }
88
+
89
+ it 'should detect 0 problems' do
90
+ expect(problems).to have(0).problems
91
+ end
92
+ end
80
93
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puppet-lint-strict_indent-check
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.6
4
+ version: 2.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Thorn
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-03 00:00:00.000000000 Z
11
+ date: 2019-02-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: puppet-lint