puppet-lint-leading_zero-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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f862a71bda3dc36ff7133683dc1a485d9a0088afcfa18a71030c5f7b70b44988
|
4
|
+
data.tar.gz: 71fcd55ce9c9c10f0e36795731692885476280890e4e3749ee28356b012a0a38
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 92eb737f16bc9bb05f118cb350d3df08e5b1ca619c64f93ce7d487dc22237da2762094e80c949fc03642651aa273af1c4045291145d41898f2c2d15f1daaac33
|
7
|
+
data.tar.gz: dd442f48ceadd771f6d0b045481b120fe85fc948c33861a13383a18aad2e38b9a831e3beeef6ecf810c1a9ddaa9afd2c07fe6234552f46d20ef25bdc134456cd
|
@@ -1,14 +1,14 @@
|
|
1
1
|
PuppetLint.new_check(:leading_zero) do
|
2
2
|
def check
|
3
3
|
tokens.each do |token|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
4
|
+
next unless token.type == :NUMBER and token.value =~ /^0\d/
|
5
|
+
|
6
|
+
notify :warning, {
|
7
|
+
message: 'unquoted number with leading zero',
|
8
|
+
line: token.line,
|
9
|
+
column: token.column,
|
10
|
+
token: token,
|
11
|
+
}
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
@@ -1,35 +1,35 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe 'leading_zero' do
|
4
|
-
let
|
4
|
+
let(:msg) { 'unquoted number with leading zero' }
|
5
5
|
|
6
6
|
context 'with fix disabled' do
|
7
7
|
context 'no unquoted numbers with leading zero' do
|
8
|
-
let
|
8
|
+
let(:code) do
|
9
9
|
<<-EOS
|
10
10
|
$foo = '010'
|
11
11
|
$bar = 10
|
12
12
|
$baz = 0
|
13
13
|
EOS
|
14
|
-
|
14
|
+
end
|
15
15
|
|
16
|
-
it '
|
16
|
+
it 'does not detect any problems' do
|
17
17
|
expect(problems).to have(0).problems
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
21
21
|
context 'unquoted numbers with leading zero' do
|
22
|
-
let
|
22
|
+
let(:code) do
|
23
23
|
<<-EOS
|
24
24
|
$foo = 010
|
25
25
|
EOS
|
26
|
-
|
26
|
+
end
|
27
27
|
|
28
|
-
it '
|
28
|
+
it 'detects a single problem' do
|
29
29
|
expect(problems).to have(1).problem
|
30
30
|
end
|
31
31
|
|
32
|
-
it '
|
32
|
+
it 'creates a warning' do
|
33
33
|
expect(problems).to contain_warning(msg).on_line(1).in_column(16)
|
34
34
|
end
|
35
35
|
end
|
@@ -45,41 +45,41 @@ describe 'leading_zero' do
|
|
45
45
|
end
|
46
46
|
|
47
47
|
context 'no unquoted numbers with leading zero' do
|
48
|
-
let
|
48
|
+
let(:code) do
|
49
49
|
<<-EOS
|
50
50
|
$foo = '010'
|
51
51
|
$bar = 10
|
52
52
|
$baz = 0
|
53
53
|
EOS
|
54
|
-
|
54
|
+
end
|
55
55
|
|
56
|
-
it '
|
56
|
+
it 'does not detect any problems' do
|
57
57
|
expect(problems).to have(0).problems
|
58
58
|
end
|
59
59
|
|
60
|
-
it '
|
60
|
+
it 'does not modify the manifest' do
|
61
61
|
expect(manifest).to eq(code)
|
62
62
|
end
|
63
63
|
end
|
64
64
|
|
65
65
|
context 'unquoted numbers with leading zero' do
|
66
|
-
let
|
66
|
+
let(:code) do
|
67
67
|
<<-EOS
|
68
68
|
$foo = 010
|
69
69
|
EOS
|
70
|
-
|
70
|
+
end
|
71
71
|
|
72
|
-
it '
|
72
|
+
it 'detects a single problem' do
|
73
73
|
expect(problems).to have(1).problem
|
74
74
|
end
|
75
75
|
|
76
|
-
it '
|
76
|
+
it 'fixes the problem' do
|
77
77
|
expect(problems).to contain_fixed(msg).on_line(1).in_column(16)
|
78
78
|
end
|
79
79
|
|
80
|
-
it '
|
80
|
+
it 'shoulds use undef' do
|
81
81
|
expect(manifest).to eq(
|
82
|
-
<<-EOS
|
82
|
+
<<-EOS,
|
83
83
|
$foo = '010'
|
84
84
|
EOS
|
85
85
|
)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puppet-lint-leading_zero-check
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
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:
|
11
|
+
date: 2023-04-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: puppet-lint
|
@@ -16,90 +16,20 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '3'
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: '
|
22
|
+
version: '5'
|
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
|
-
version: '
|
29
|
+
version: '3'
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: '
|
33
|
-
- !ruby/object:Gem::Dependency
|
34
|
-
name: rspec
|
35
|
-
requirement: !ruby/object:Gem::Requirement
|
36
|
-
requirements:
|
37
|
-
- - "~>"
|
38
|
-
- !ruby/object:Gem::Version
|
39
|
-
version: '3.0'
|
40
|
-
type: :development
|
41
|
-
prerelease: false
|
42
|
-
version_requirements: !ruby/object:Gem::Requirement
|
43
|
-
requirements:
|
44
|
-
- - "~>"
|
45
|
-
- !ruby/object:Gem::Version
|
46
|
-
version: '3.0'
|
47
|
-
- !ruby/object:Gem::Dependency
|
48
|
-
name: rspec-its
|
49
|
-
requirement: !ruby/object:Gem::Requirement
|
50
|
-
requirements:
|
51
|
-
- - "~>"
|
52
|
-
- !ruby/object:Gem::Version
|
53
|
-
version: '1.0'
|
54
|
-
type: :development
|
55
|
-
prerelease: false
|
56
|
-
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
requirements:
|
58
|
-
- - "~>"
|
59
|
-
- !ruby/object:Gem::Version
|
60
|
-
version: '1.0'
|
61
|
-
- !ruby/object:Gem::Dependency
|
62
|
-
name: rspec-collection_matchers
|
63
|
-
requirement: !ruby/object:Gem::Requirement
|
64
|
-
requirements:
|
65
|
-
- - "~>"
|
66
|
-
- !ruby/object:Gem::Version
|
67
|
-
version: '1.0'
|
68
|
-
type: :development
|
69
|
-
prerelease: false
|
70
|
-
version_requirements: !ruby/object:Gem::Requirement
|
71
|
-
requirements:
|
72
|
-
- - "~>"
|
73
|
-
- !ruby/object:Gem::Version
|
74
|
-
version: '1.0'
|
75
|
-
- !ruby/object:Gem::Dependency
|
76
|
-
name: simplecov
|
77
|
-
requirement: !ruby/object:Gem::Requirement
|
78
|
-
requirements:
|
79
|
-
- - ">="
|
80
|
-
- !ruby/object:Gem::Version
|
81
|
-
version: '0'
|
82
|
-
type: :development
|
83
|
-
prerelease: false
|
84
|
-
version_requirements: !ruby/object:Gem::Requirement
|
85
|
-
requirements:
|
86
|
-
- - ">="
|
87
|
-
- !ruby/object:Gem::Version
|
88
|
-
version: '0'
|
89
|
-
- !ruby/object:Gem::Dependency
|
90
|
-
name: rake
|
91
|
-
requirement: !ruby/object:Gem::Requirement
|
92
|
-
requirements:
|
93
|
-
- - ">="
|
94
|
-
- !ruby/object:Gem::Version
|
95
|
-
version: '0'
|
96
|
-
type: :development
|
97
|
-
prerelease: false
|
98
|
-
version_requirements: !ruby/object:Gem::Requirement
|
99
|
-
requirements:
|
100
|
-
- - ">="
|
101
|
-
- !ruby/object:Gem::Version
|
102
|
-
version: '0'
|
32
|
+
version: '5'
|
103
33
|
description: " A puppet-lint plugin to check for unquoted numbers with leading
|
104
34
|
zero.\n"
|
105
35
|
email: voxpupuli@groups.io
|
@@ -124,17 +54,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
124
54
|
requirements:
|
125
55
|
- - ">="
|
126
56
|
- !ruby/object:Gem::Version
|
127
|
-
version:
|
57
|
+
version: 2.7.0
|
128
58
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
129
59
|
requirements:
|
130
60
|
- - ">="
|
131
61
|
- !ruby/object:Gem::Version
|
132
62
|
version: '0'
|
133
63
|
requirements: []
|
134
|
-
rubygems_version: 3.2.
|
64
|
+
rubygems_version: 3.2.33
|
135
65
|
signing_key:
|
136
66
|
specification_version: 4
|
137
67
|
summary: A puppet-lint plugin to check for unquoted numbers with leading zero.
|
138
|
-
test_files:
|
139
|
-
- spec/puppet-lint/plugins/check_leading_zero/check_leading_zero_spec.rb
|
140
|
-
- spec/spec_helper.rb
|
68
|
+
test_files: []
|