puppet-lint-leading_zero-check 1.1.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: 7ec67794fd06f168d066c55406fcee4441866e5bdd82856b1a506b929198fd49
4
- data.tar.gz: cf60f4b0326fdc2e4b122d2c37dccf38a7f7b2476601cfaf4e98a9574ced3c0b
3
+ metadata.gz: f862a71bda3dc36ff7133683dc1a485d9a0088afcfa18a71030c5f7b70b44988
4
+ data.tar.gz: 71fcd55ce9c9c10f0e36795731692885476280890e4e3749ee28356b012a0a38
5
5
  SHA512:
6
- metadata.gz: 87aefd4f4335380c8f2d9c37f628f5097a7cd76779ac06970bfb9d2fe6e4bb0bfa6466ef65c569a3516f8aba84a79885148739993db174fc38e349e1b89d3aff
7
- data.tar.gz: a95cf6d1cb9eaefcddbfcf3b60d1a27b5aa09bea24e8873cfa9f78a65f3f4543380075523c9fa854c6a935b5fc973fe5849845c4538f3b0ff0fa777227ebb0a4
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
- if token.type == :NUMBER and token.value =~ /^0\d/
5
- notify :warning, {
6
- :message => 'unquoted number with leading zero',
7
- :line => token.line,
8
- :column => token.column,
9
- :token => token,
10
- }
11
- end
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 (:msg) { 'unquoted number with leading zero' }
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 (:code) {
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 'should not detect any problems' do
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 (:code) {
22
+ let(:code) do
23
23
  <<-EOS
24
24
  $foo = 010
25
25
  EOS
26
- }
26
+ end
27
27
 
28
- it 'should detect a single problem' do
28
+ it 'detects a single problem' do
29
29
  expect(problems).to have(1).problem
30
30
  end
31
31
 
32
- it 'should create a warning' do
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 (:code) {
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 'should not detect any problems' do
56
+ it 'does not detect any problems' do
57
57
  expect(problems).to have(0).problems
58
58
  end
59
59
 
60
- it 'should not modify the manifest' do
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 (:code) {
66
+ let(:code) do
67
67
  <<-EOS
68
68
  $foo = 010
69
69
  EOS
70
- }
70
+ end
71
71
 
72
- it 'should detect a single problem' do
72
+ it 'detects a single problem' do
73
73
  expect(problems).to have(1).problem
74
74
  end
75
75
 
76
- it 'should fix the problem' do
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 'should should use undef' do
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: 1.1.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: 2023-02-24 00:00:00.000000000 Z
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: '1.0'
19
+ version: '3'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '4.0'
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: '1.0'
29
+ version: '3'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '4.0'
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,7 +54,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
124
54
  requirements:
125
55
  - - ">="
126
56
  - !ruby/object:Gem::Version
127
- version: '0'
57
+ version: 2.7.0
128
58
  required_rubygems_version: !ruby/object:Gem::Requirement
129
59
  requirements:
130
60
  - - ">="
@@ -135,6 +65,4 @@ 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: []