puppet-lint-unquoted_string-check 1.0.0 → 2.0.0

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: e98c28603db37044ee14ffae7a038dabe5231eeba2293f192aba89f3d4ec6c9d
4
- data.tar.gz: 7a1421684d95face81b81bdeb50388cbab28cd1e093414d801b12ce202aa4c5e
3
+ metadata.gz: 4b74178d306fe7d8673bba37f7589f143e743f1cabf422a99b1b8ebcc875b21f
4
+ data.tar.gz: 03a09e744bdac7f641f27ca688474218ad1d51481c419386dac4320fb9526ef9
5
5
  SHA512:
6
- metadata.gz: 8aa08133b84dc79ef322ced02da42bde2ca7adddb07f57a7d6b80a9e3278546ff7e38f71b101f110485f9605fcf056be80d4e8cc5986861cde29711aa5fc3f71
7
- data.tar.gz: 25ce700012433f0b2389ecdd681e1657b5de7bdc9f82b73fad43b7ec9f5dcc1a4355323ce77a9a3ca44ad5b50a48895719710f66fc0d9d4214715da720ea2b7e
6
+ metadata.gz: 7439c28358580769dd50f40418c0bf49e1d8b63228cc88899429fdf73250de5c965452903897a33b1dd437e3b3505c76dae7a621a61dc86e7b11626cb698af2d
7
+ data.tar.gz: d7dce532c741423327245e2a882ff54c8d49bd23158d9d34f5eb7bf195f01e5f00d2ab57fbbf71989913234a2f8c6385d2e6e93540d6256f8209a9d7aa7b0e92
@@ -1,4 +1,4 @@
1
1
  class PuppetLintUnquotedStringCheck
2
- VERSION = '1.0.0'.freeze
2
+ VERSION = '2.0.0'.freeze
3
3
  end
4
4
 
@@ -36,7 +36,7 @@ def notify_tokens(type, sep_type, message)
36
36
  if r.type == sep_type
37
37
  s = r.prev_token
38
38
  while (s.type != :NEWLINE) && (s.type != :LBRACE)
39
- if (s.type == :NAME || s.type == :CLASSREF) && (s.type != :TYPE)
39
+ if s.type == :NAME || (s.type == :CLASSREF && !s.value.include?('::'))
40
40
  notify :warning, {
41
41
  :message => message,
42
42
  :line => s.line,
@@ -54,7 +54,7 @@ end
54
54
  PuppetLint.new_check(:unquoted_string_in_case) do
55
55
  def check
56
56
  notify_tokens(:CASE, :COLON, 'unquoted string in case')
57
- end
57
+ end
58
58
 
59
59
  def fix(problem)
60
60
  problem[:token].type = :SSTRING
@@ -64,7 +64,7 @@ end
64
64
  PuppetLint.new_check(:unquoted_string_in_selector) do
65
65
  def check
66
66
  notify_tokens(:QMARK, :FARROW, 'unquoted string in selector')
67
- end
67
+ end
68
68
 
69
69
  def fix(problem)
70
70
  problem[:token].type = :SSTRING
@@ -51,6 +51,22 @@ describe 'unquoted_string_in_selector' do
51
51
  expect(problems).to contain_warning(msg).on_line(2).in_column(11)
52
52
  end
53
53
  end
54
+
55
+ context ':TYPE in case' do
56
+ let(:code) do
57
+ <<-PUPPET
58
+ $listen_socket = $service_bind ? {
59
+ Undef => undef,
60
+ Stdlib::IP::Address::V6 => "[${service_bind}]:${service_port}",
61
+ default => "${service_bind}:${service_port}",
62
+ }
63
+ PUPPET
64
+ end
65
+
66
+ it 'should not detect any problems' do
67
+ expect(problems).to have(0).problems
68
+ end
69
+ end
54
70
  end
55
71
 
56
72
  context 'with fix enabled' do
@@ -1,7 +1,5 @@
1
- unless RUBY_VERSION =~ /^1\.8/
2
- require 'coveralls'
3
- Coveralls.wear!
4
- end
1
+ require 'coveralls'
2
+ Coveralls.wear!
5
3
 
6
4
  require 'puppet-lint'
7
5
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puppet-lint-unquoted_string-check
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vox Pupuli
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-22 00:00:00.000000000 Z
11
+ date: 2020-03-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: puppet-lint
@@ -86,20 +86,6 @@ dependencies:
86
86
  - - ">="
87
87
  - !ruby/object:Gem::Version
88
88
  version: '0'
89
- - !ruby/object:Gem::Dependency
90
- name: mime-types
91
- requirement: !ruby/object:Gem::Requirement
92
- requirements:
93
- - - "~>"
94
- - !ruby/object:Gem::Version
95
- version: '1.0'
96
- type: :development
97
- prerelease: false
98
- version_requirements: !ruby/object:Gem::Requirement
99
- requirements:
100
- - - "~>"
101
- - !ruby/object:Gem::Version
102
- version: '1.0'
103
89
  - !ruby/object:Gem::Dependency
104
90
  name: coveralls
105
91
  requirement: !ruby/object:Gem::Requirement
@@ -152,9 +138,9 @@ require_paths:
152
138
  - lib
153
139
  required_ruby_version: !ruby/object:Gem::Requirement
154
140
  requirements:
155
- - - ">="
141
+ - - "~>"
156
142
  - !ruby/object:Gem::Version
157
- version: '0'
143
+ version: '2.4'
158
144
  required_rubygems_version: !ruby/object:Gem::Requirement
159
145
  requirements:
160
146
  - - ">="