puppet-lint-explicit_hiera_class_param_lookup-check 0.1.1 → 0.1.2

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: 9d78fb1aec02dfbce78e457d7fb07026a419ffb4
4
- data.tar.gz: 6321e709196073636f407cae3c3aa9abe03cb2ba
3
+ metadata.gz: 219cbf1a58a7fb38484f9167bf99f662ae7dd647
4
+ data.tar.gz: 2933b085bc8ca4f3d4a62173ee1394bee845408e
5
5
  SHA512:
6
- metadata.gz: 0d98755a180f46b2bbb5b54bea338601e8b30291289c4488c25e92101095bf99189c90f447166d8912366d85990a535bdc33f43fb3c147eaf54ab0a3c3b1d9da
7
- data.tar.gz: 16ec51044d83354847df85ecc81b71675caf17eb5ec1d1404e8ccb3aebe331ebbf0fa17f9f4c711fa2c6073fa5a90ab8750c0379ed0b3f858f2620be46f80eef
6
+ metadata.gz: b82311c04633ece5e89123cb67ab9b372fba78001228e8741be4209f4530fdc9099e50961a2cb459cdad7952606ffb70a4337fac6fe1807fb1b3cc3a2a680aa8
7
+ data.tar.gz: 8315f4503ff67f9284e67e62415b60973cdd9e99f222b76b6554e99e564e16629713b7eb892d274ea7cb7e8b3ff8899f575be5daae2d7d8713485664335d8bb5
data/README.md CHANGED
@@ -3,6 +3,8 @@
3
3
  Extends puppet-lint to ensure there are no explicit calls to hiera()
4
4
  in the class parameters.
5
5
 
6
+ [![Build Status](https://travis-ci.org/deanwilson/puppet-lint-explicit_hiera_class_param_lookup-check.svg?branch=master)](https://travis-ci.org/deanwilson/puppet-lint-explicit_hiera_class_param_lookup-check)
7
+
6
8
  In our code base we would rather have a class lookup values for its
7
9
  parameters using Puppets automatic data binding functionality rather than
8
10
  scatter a number of direct, unpredictably name spaced, hiera calls
@@ -2,8 +2,10 @@ PuppetLint.new_check(:explicit_hiera_class_param_lookup) do
2
2
  def check
3
3
  class_indexes.each do |class_idx|
4
4
 
5
+ next unless class_idx[:param_tokens].is_a? Array
6
+
5
7
  class_idx[:param_tokens].select { |t|
6
- t.type == :NAME and t.value == 'hiera'
8
+ (t.type == :NAME or t.type == :FUNCTION_NAME) and t.value == 'hiera'
7
9
  }.each do |token|
8
10
 
9
11
  next unless token.next_code_token.type == :LPAREN
@@ -45,4 +45,17 @@ describe 'explicit_hiera_class_param_lookup' do
45
45
  end
46
46
  end
47
47
 
48
+ ### Reported issues
49
+ context 'empty class with inherit and no explicit hiera() lookups' do
50
+ let(:code) do
51
+ <<-EOS
52
+ class ig::base::freebsd inherits ig::base { }
53
+ EOS
54
+ end
55
+
56
+ it 'should not detect any problems' do
57
+ expect(problems).to have(0).problems
58
+ end
59
+ end
60
+
48
61
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puppet-lint-explicit_hiera_class_param_lookup-check
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dean Wilson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-21 00:00:00.000000000 Z
11
+ date: 2018-02-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: puppet-lint
@@ -36,14 +36,14 @@ dependencies:
36
36
  requirements:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: '3.0'
39
+ version: 3.5.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
- version: '3.0'
46
+ version: 3.5.0
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rspec-its
49
49
  requirement: !ruby/object:Gem::Requirement
@@ -73,47 +73,47 @@ dependencies:
73
73
  - !ruby/object:Gem::Version
74
74
  version: '1.0'
75
75
  - !ruby/object:Gem::Dependency
76
- name: rake
76
+ name: rubocop
77
77
  requirement: !ruby/object:Gem::Requirement
78
78
  requirements:
79
- - - ">="
79
+ - - "~>"
80
80
  - !ruby/object:Gem::Version
81
- version: '0'
81
+ version: 0.47.1
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
- version: '0'
88
+ version: 0.47.1
89
89
  - !ruby/object:Gem::Dependency
90
- name: pry
90
+ name: rake
91
91
  requirement: !ruby/object:Gem::Requirement
92
92
  requirements:
93
- - - ">="
93
+ - - "~>"
94
94
  - !ruby/object:Gem::Version
95
- version: '0'
95
+ version: 11.2.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
- version: '0'
102
+ version: 11.2.0
103
103
  - !ruby/object:Gem::Dependency
104
- name: rubocop
104
+ name: rspec-json_expectations
105
105
  requirement: !ruby/object:Gem::Requirement
106
106
  requirements:
107
107
  - - "~>"
108
108
  - !ruby/object:Gem::Version
109
- version: 0.36.0
109
+ version: '1.4'
110
110
  type: :development
111
111
  prerelease: false
112
112
  version_requirements: !ruby/object:Gem::Requirement
113
113
  requirements:
114
114
  - - "~>"
115
115
  - !ruby/object:Gem::Version
116
- version: 0.36.0
116
+ version: '1.4'
117
117
  description: |2
118
118
  Extends puppet-lint to ensure there are no explicit calls to hiera()
119
119
  in the class parameters.
@@ -147,11 +147,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
147
147
  version: '0'
148
148
  requirements: []
149
149
  rubyforge_project:
150
- rubygems_version: 2.4.8
150
+ rubygems_version: 2.4.5.1
151
151
  signing_key:
152
152
  specification_version: 4
153
153
  summary: puppet-lint explicit_hiera_class_param_lookup check
154
154
  test_files:
155
155
  - spec/spec_helper.rb
156
156
  - spec/puppet-lint/plugins/puppet-lint-explicit_hiera_class_param_lookup_spec.rb
157
- has_rdoc: