puppet-lint-anchor-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 +4 -4
- data/lib/puppet-lint/plugins/check_anchor.rb +3 -2
- data/spec/puppet-lint/plugins/check_anchor_spec.rb +24 -21
- metadata +8 -80
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '008d257e37397869478e508ce7e7c8510be736aa741540f6f6952f14cac4b0ff'
|
4
|
+
data.tar.gz: 8861d361f5c59f2e9a6390b149d2682fa0b63c15fcd28392c0871daf75c515b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a216119b407ee1bc9277bfebba32a051845e620f7be936a84da8561762f7ab5f7e3a7fa14510a83bb577865fa6cdb87c3d60fd4dc750ee0b03293b5be1f9c31d
|
7
|
+
data.tar.gz: c0f50108e493347bb453e6752ad5c081f6ddb4409b66f91cce1acedf1875baa1d18ad808432289105119bf0dbecbd1f1709aab9e89a39b4e911521b91c392a5b
|
@@ -2,11 +2,12 @@ PuppetLint.new_check(:anchor_resource) do
|
|
2
2
|
def check
|
3
3
|
resource_indexes.each do |resource|
|
4
4
|
next unless resource[:type].value == 'anchor'
|
5
|
+
|
5
6
|
notify(
|
6
7
|
:warning,
|
7
8
|
message: 'manifest includes anchor resource',
|
8
|
-
line:
|
9
|
-
column:
|
9
|
+
line: resource[:type].line,
|
10
|
+
column: resource[:type].column,
|
10
11
|
)
|
11
12
|
end
|
12
13
|
end
|
@@ -2,28 +2,31 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe 'anchor_resource' do
|
4
4
|
let(:msg) { 'manifest includes anchor resource' }
|
5
|
+
|
5
6
|
context 'stdlib ntp example' do
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
7
|
+
let(:code) do
|
8
|
+
<<~CODE
|
9
|
+
class ntp {
|
10
|
+
# These classes will have the correct order relationship with each
|
11
|
+
# other. However, without anchors, they won't have any order
|
12
|
+
# relationship to Class['ntp'].
|
13
|
+
class { 'ntp::package': }
|
14
|
+
-> class { 'ntp::config': }
|
15
|
+
-> class { 'ntp::service': }
|
16
|
+
|
17
|
+
# These two resources "anchor" the composed classes within the ntp
|
18
|
+
# class.
|
19
|
+
anchor { 'ntp::begin': } -> Class['ntp::package']
|
20
|
+
Class['ntp::service'] -> anchor { 'ntp::end': }
|
21
|
+
}
|
22
|
+
CODE
|
23
|
+
end
|
24
|
+
|
25
|
+
it 'creates two warnings' do
|
26
|
+
expect(problems).to have(2).problems
|
27
|
+
end
|
15
28
|
|
16
|
-
|
17
|
-
|
18
|
-
anchor { 'ntp::begin': } -> Class['ntp::package']
|
19
|
-
Class['ntp::service'] -> anchor { 'ntp::end': }
|
20
|
-
}
|
21
|
-
CODE
|
22
|
-
end
|
23
|
-
it 'should create two warnings' do
|
24
|
-
expect(problems).to have(2).problems
|
25
|
-
end
|
26
|
-
it { expect(problems).to contain_warning(msg).on_line(11).in_column(3) }
|
27
|
-
it { expect(problems).to contain_warning(msg).on_line(12).in_column(31) }
|
29
|
+
it { expect(problems).to contain_warning(msg).on_line(11).in_column(3) }
|
30
|
+
it { expect(problems).to contain_warning(msg).on_line(12).in_column(31) }
|
28
31
|
end
|
29
32
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puppet-lint-anchor-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: rake
|
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: simplecov
|
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 check for puppet-lint that validates no anchor resources are used\n"
|
104
34
|
email: voxpupuli@groups.io
|
105
35
|
executables: []
|
@@ -123,7 +53,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
123
53
|
requirements:
|
124
54
|
- - ">="
|
125
55
|
- !ruby/object:Gem::Version
|
126
|
-
version:
|
56
|
+
version: 2.7.0
|
127
57
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
128
58
|
requirements:
|
129
59
|
- - ">="
|
@@ -134,6 +64,4 @@ rubygems_version: 3.2.33
|
|
134
64
|
signing_key:
|
135
65
|
specification_version: 4
|
136
66
|
summary: puppet-lint check to validate legacy anchor pattern is not used
|
137
|
-
test_files:
|
138
|
-
- spec/puppet-lint/plugins/check_anchor_spec.rb
|
139
|
-
- spec/spec_helper.rb
|
67
|
+
test_files: []
|