puppet-lint-variable_contains_upcase 1.1.0 → 1.2.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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0ec1a24641d263daccbc1f4c6f25526c4011ae85
|
4
|
+
data.tar.gz: 215d99fac66d8bc5f88e4e9f1c69d3098b4fea08
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e7c2d993d8893c3add222367c20cf4c94c30d33ac78cc23734a18cea3c6b196f6452e2d7a54a737f904ccb135f8402331b317dc2da20e53b031dabe800d19371
|
7
|
+
data.tar.gz: c0f0b18e25a1a7199164c78100fd7bbbefda2cec31f34af8e037729f2e95c2b382ff0a7ead28ba6ca043a349946108028026f0d7521fd0669e1e2f8f52db1945
|
data/README.md
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
# Puppet lint check for upcase variables
|
2
2
|
|
3
3
|
[![Build Status](https://travis-ci.org/fiddyspence/puppetlint-variablecase.png?branch=master)](https://travis-ci.org/fiddyspence/puppetlint-variablecase)
|
4
|
-
[![puppet-lint-variable_contains_upcase API Documentation](https://www.omniref.com/ruby/gems/puppet-lint-variable_contains_upcase.png)](https://www.omniref.com/ruby/gems/puppet-lint-variable_contains_upcase)
|
5
4
|
|
6
5
|
The future parser disallows mixed case variables, so this check implements
|
7
6
|
warnings for them
|
@@ -3,7 +3,7 @@ PuppetLint.new_check(:variable_contains_upcase) do
|
|
3
3
|
tokens.select { |r|
|
4
4
|
Set[:VARIABLE, :UNENC_VARIABLE].include? r.type
|
5
5
|
}.each do |token|
|
6
|
-
if token.value.match(/[A-Z]/)
|
6
|
+
if token.value.gsub(/\[.+?\]/, '').match(/[A-Z]/)
|
7
7
|
notify :warning, {
|
8
8
|
:message => 'variable contains a capital letter',
|
9
9
|
:line => token.line,
|
@@ -14,6 +14,6 @@ PuppetLint.new_check(:variable_contains_upcase) do
|
|
14
14
|
end
|
15
15
|
end
|
16
16
|
def fix(problem)
|
17
|
-
problem[:token].value.downcase
|
17
|
+
problem[:token].value.downcase!
|
18
18
|
end
|
19
19
|
end
|
@@ -52,5 +52,26 @@ describe 'variable_contains_upcase' do
|
|
52
52
|
end
|
53
53
|
end
|
54
54
|
|
55
|
+
context 'a hash with an upcase key should not fail' do
|
56
|
+
let(:code) { ' $myhash["Foo"]' }
|
57
|
+
|
58
|
+
it 'should not detect a single problem' do
|
59
|
+
expect(problems).to have(0).problem
|
60
|
+
end
|
61
|
+
end
|
62
|
+
context 'a hash with an upcase key should not fail' do
|
63
|
+
let(:code) { ' $myhash["Foo"]["bAr"]' }
|
64
|
+
|
65
|
+
it 'should not detect a single problem' do
|
66
|
+
expect(problems).to have(0).problem
|
67
|
+
end
|
68
|
+
end
|
69
|
+
context 'a hash variable with an upcase key should fail' do
|
70
|
+
let(:code) { ' $myHash["foo"]["bar"]' }
|
71
|
+
|
72
|
+
it 'should detect a single problem' do
|
73
|
+
expect(problems).to have(1).problem
|
74
|
+
end
|
75
|
+
end
|
55
76
|
end
|
56
77
|
end
|
metadata
CHANGED
@@ -1,103 +1,103 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puppet-lint-variable_contains_upcase
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Spence
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-02-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: puppet-lint
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.0'
|
20
|
-
- - <
|
20
|
+
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
22
|
version: '3.0'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
|
-
- -
|
27
|
+
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
29
|
version: '1.0'
|
30
|
-
- - <
|
30
|
+
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: '3.0'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: rspec
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
37
|
-
- - ~>
|
37
|
+
- - "~>"
|
38
38
|
- !ruby/object:Gem::Version
|
39
39
|
version: '3.0'
|
40
40
|
type: :development
|
41
41
|
prerelease: false
|
42
42
|
version_requirements: !ruby/object:Gem::Requirement
|
43
43
|
requirements:
|
44
|
-
- - ~>
|
44
|
+
- - "~>"
|
45
45
|
- !ruby/object:Gem::Version
|
46
46
|
version: '3.0'
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: rspec-its
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
50
50
|
requirements:
|
51
|
-
- - ~>
|
51
|
+
- - "~>"
|
52
52
|
- !ruby/object:Gem::Version
|
53
53
|
version: '1.0'
|
54
54
|
type: :development
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
57
|
requirements:
|
58
|
-
- - ~>
|
58
|
+
- - "~>"
|
59
59
|
- !ruby/object:Gem::Version
|
60
60
|
version: '1.0'
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
62
|
name: rspec-collection_matchers
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|
64
64
|
requirements:
|
65
|
-
- - ~>
|
65
|
+
- - "~>"
|
66
66
|
- !ruby/object:Gem::Version
|
67
67
|
version: '1.0'
|
68
68
|
type: :development
|
69
69
|
prerelease: false
|
70
70
|
version_requirements: !ruby/object:Gem::Requirement
|
71
71
|
requirements:
|
72
|
-
- - ~>
|
72
|
+
- - "~>"
|
73
73
|
- !ruby/object:Gem::Version
|
74
74
|
version: '1.0'
|
75
75
|
- !ruby/object:Gem::Dependency
|
76
76
|
name: rake
|
77
77
|
requirement: !ruby/object:Gem::Requirement
|
78
78
|
requirements:
|
79
|
-
- -
|
79
|
+
- - ">="
|
80
80
|
- !ruby/object:Gem::Version
|
81
81
|
version: '0'
|
82
82
|
type: :development
|
83
83
|
prerelease: false
|
84
84
|
version_requirements: !ruby/object:Gem::Requirement
|
85
85
|
requirements:
|
86
|
-
- -
|
86
|
+
- - ">="
|
87
87
|
- !ruby/object:Gem::Version
|
88
88
|
version: '0'
|
89
89
|
- !ruby/object:Gem::Dependency
|
90
90
|
name: rspec-json_expectations
|
91
91
|
requirement: !ruby/object:Gem::Requirement
|
92
92
|
requirements:
|
93
|
-
- -
|
93
|
+
- - ">="
|
94
94
|
- !ruby/object:Gem::Version
|
95
95
|
version: '0'
|
96
96
|
type: :development
|
97
97
|
prerelease: false
|
98
98
|
version_requirements: !ruby/object:Gem::Requirement
|
99
99
|
requirements:
|
100
|
-
- -
|
100
|
+
- - ">="
|
101
101
|
- !ruby/object:Gem::Version
|
102
102
|
version: '0'
|
103
103
|
description: |2
|
@@ -107,8 +107,8 @@ executables: []
|
|
107
107
|
extensions: []
|
108
108
|
extra_rdoc_files: []
|
109
109
|
files:
|
110
|
-
- README.md
|
111
110
|
- LICENSE
|
111
|
+
- README.md
|
112
112
|
- lib/puppet-lint/plugins/variable_contains_upcase.rb
|
113
113
|
- spec/puppet-lint/plugins/variable_contains_upcase_spec.rb
|
114
114
|
- spec/spec_helper.rb
|
@@ -122,17 +122,17 @@ require_paths:
|
|
122
122
|
- lib
|
123
123
|
required_ruby_version: !ruby/object:Gem::Requirement
|
124
124
|
requirements:
|
125
|
-
- -
|
125
|
+
- - ">="
|
126
126
|
- !ruby/object:Gem::Version
|
127
127
|
version: '0'
|
128
128
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
129
129
|
requirements:
|
130
|
-
- -
|
130
|
+
- - ">="
|
131
131
|
- !ruby/object:Gem::Version
|
132
132
|
version: '0'
|
133
133
|
requirements: []
|
134
134
|
rubyforge_project:
|
135
|
-
rubygems_version: 2.
|
135
|
+
rubygems_version: 2.2.2
|
136
136
|
signing_key:
|
137
137
|
specification_version: 4
|
138
138
|
summary: puppet-lint variable_case check
|