puppet-lint-anchor-check 1.0.1 → 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: 3cb1255de1dab5d83e695705f38cc568a59af8fb4939d38a325d6866cac4f5e5
4
- data.tar.gz: 5359ecda5813ef437afedb74801aeee1eaa49980ff3bda7c0d8705121ebc0051
3
+ metadata.gz: '008d257e37397869478e508ce7e7c8510be736aa741540f6f6952f14cac4b0ff'
4
+ data.tar.gz: 8861d361f5c59f2e9a6390b149d2682fa0b63c15fcd28392c0871daf75c515b8
5
5
  SHA512:
6
- metadata.gz: 0b0788d470cbaa5a0247f3cb972c94afc22d0c99bbad32a5de64761143895d2e071f66e6d30984699b95c932d9635876379186a0a398a636c3581f3ca42e8f0e
7
- data.tar.gz: fa3c5eca6cba0d69672bf77d54d975cdf556717ac36fd74fe7148a7ba2fc851be5bec2dd3b123dce1a0d86eda619e1551209c670900e5295680edebb1c42dd12
6
+ metadata.gz: a216119b407ee1bc9277bfebba32a051845e620f7be936a84da8561762f7ab5f7e3a7fa14510a83bb577865fa6cdb87c3d60fd4dc750ee0b03293b5be1f9c31d
7
+ data.tar.gz: c0f50108e493347bb453e6752ad5c081f6ddb4409b66f91cce1acedf1875baa1d18ad808432289105119bf0dbecbd1f1709aab9e89a39b4e911521b91c392a5b
data/README.md CHANGED
@@ -3,6 +3,7 @@ puppet-lint-anchor-check
3
3
 
4
4
  [![License](https://img.shields.io/github/license/voxpupuli/puppet-lint-anchor-check.svg)](https://github.com/voxpupuli/puppet-lint-anchor-check/blob/master/LICENSE)
5
5
  [![Test](https://github.com/voxpupuli/puppet-lint-anchor-check/actions/workflows/test.yml/badge.svg)](https://github.com/voxpupuli/puppet-lint-anchor-check/actions/workflows/test.yml)
6
+ [![codecov](https://codecov.io/gh/voxpupuli/puppet-lint-anchor-check/branch/master/graph/badge.svg?token=Mypkl78hvK)](https://codecov.io/gh/voxpupuli/puppet-lint-anchor-check)
6
7
  [![Release](https://github.com/voxpupuli/puppet-lint-anchor-check/actions/workflows/release.yml/badge.svg)](https://github.com/voxpupuli/puppet-lint-anchor-check/actions/workflows/release.yml)
7
8
  [![RubyGem Version](https://img.shields.io/gem/v/puppet-lint-anchor-check.svg)](https://rubygems.org/gems/puppet-lint-anchor-check)
8
9
  [![RubyGem Downloads](https://img.shields.io/gem/dt/puppet-lint-anchor-check.svg)](https://rubygems.org/gems/puppet-lint-anchor-check)
@@ -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: resource[:type].line,
9
- column: resource[:type].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
- let(:code) do
7
- <<~CODE
8
- class ntp {
9
- # These classes will have the correct order relationship with each
10
- # other. However, without anchors, they won't have any order
11
- # relationship to Class['ntp'].
12
- class { 'ntp::package': }
13
- -> class { 'ntp::config': }
14
- -> class { 'ntp::service': }
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
- # These two resources "anchor" the composed classes within the ntp
17
- # class.
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
data/spec/spec_helper.rb CHANGED
@@ -1,3 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ begin
4
+ require 'simplecov'
5
+ require 'simplecov-console'
6
+ require 'codecov'
7
+ rescue LoadError
8
+ else
9
+ SimpleCov.start do
10
+ track_files 'lib/**/*.rb'
11
+
12
+ add_filter '/spec'
13
+
14
+ enable_coverage :branch
15
+
16
+ # do not track vendored files
17
+ add_filter '/vendor'
18
+ add_filter '/.vendor'
19
+ end
20
+
21
+ SimpleCov.formatters = [
22
+ SimpleCov::Formatter::Console,
23
+ SimpleCov::Formatter::Codecov,
24
+ ]
25
+ end
26
+
1
27
  require 'puppet-lint'
2
28
 
3
29
  PuppetLint::Plugins.load_spec_helper
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: 1.0.1
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: 2021-06-19 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.1'
19
+ version: '3'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '3.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.1'
29
+ version: '3'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '3.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: 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: coveralls
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,17 +53,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
123
53
  requirements:
124
54
  - - ">="
125
55
  - !ruby/object:Gem::Version
126
- version: '0'
56
+ version: 2.7.0
127
57
  required_rubygems_version: !ruby/object:Gem::Requirement
128
58
  requirements:
129
59
  - - ">="
130
60
  - !ruby/object:Gem::Version
131
61
  version: '0'
132
62
  requirements: []
133
- rubygems_version: 3.2.15
63
+ 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: []