puppet-ghostbuster 0.7.1 → 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/lib/puppet-ghostbuster/version.rb +1 -1
- data/lib/puppet-lint/plugins/check_ghostbuster_classes.rb +14 -0
- data/lib/puppet-lint/plugins/check_ghostbuster_defines.rb +14 -0
- data/lib/puppet-lint/plugins/check_ghostbuster_facts.rb +15 -0
- data/lib/puppet-lint/plugins/check_ghostbuster_functions.rb +14 -0
- data/lib/puppet-lint/plugins/check_ghostbuster_hiera_files.rb +14 -0
- data/lib/puppet-lint/plugins/check_ghostbuster_types.rb +14 -0
- data/spec/fixtures/modules/foo/lib/facter/quux.rb +6 -0
- data/spec/fixtures/modules/foo/manifests/bar.pp +3 -0
- data/spec/puppet-lint/plugins/ghostbuster_facts_spec.rb +8 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8b2e06b759612d9b773d0d6eb3efaef0b91acc36
|
4
|
+
data.tar.gz: c38603601072ff8cbb8a7dae4ffd44fd26965091
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa349856ba8787af3b7aea3bd2640cd73e571b7ea459d87108f48d0c85bf8a7562724dca6d47e6978fd735def66ee34e4c5c5efafed48986e24deb18474d4744
|
7
|
+
data.tar.gz: d396dee2c8f039f3b6a41a4af415b642b0a5d8db916f502b591c27f3610cbb2f104ae186d77863f1d64460186385b3651c37f17274b9e9e9f1c2ffbe327fec16
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## [0.7.2](https://rubygems.org/gems/puppet-ghostbuster/versions/0.7.2) (2016-05-19)
|
4
|
+
[Full Changelog](https://github.com/camptocamp/puppet-ghostbuster/compare/0.7.1...0.7.2)
|
5
|
+
|
6
|
+
**Fixed bugs:**
|
7
|
+
|
8
|
+
- Detect facts used in inline_templates()
|
9
|
+
|
3
10
|
## [0.7.1](https://rubygems.org/gems/puppet-ghostbuster/versions/0.7.1) (2016-05-16)
|
4
11
|
[Full Changelog](https://github.com/camptocamp/puppet-ghostbuster/compare/0.7.0...0.7.1)
|
5
12
|
|
@@ -1,5 +1,19 @@
|
|
1
1
|
require 'puppet-ghostbuster/puppetdb'
|
2
2
|
|
3
|
+
class PuppetLint::Checks
|
4
|
+
def load_data(path, content)
|
5
|
+
lexer = PuppetLint::Lexer.new
|
6
|
+
PuppetLint::Data.path = path
|
7
|
+
begin
|
8
|
+
PuppetLint::Data.manifest_lines = content.split("\n", -1)
|
9
|
+
PuppetLint::Data.tokens = lexer.tokenise(content)
|
10
|
+
PuppetLint::Data.parse_control_comments
|
11
|
+
rescue
|
12
|
+
PuppetLint::Data.tokens = []
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
3
17
|
PuppetLint.new_check(:ghostbuster_classes) do
|
4
18
|
def check
|
5
19
|
return if path.match(%r{^\./(:?[^/]+/){2}?manifests/.+$}).nil?
|
@@ -1,5 +1,19 @@
|
|
1
1
|
require 'puppet-ghostbuster/puppetdb'
|
2
2
|
|
3
|
+
class PuppetLint::Checks
|
4
|
+
def load_data(path, content)
|
5
|
+
lexer = PuppetLint::Lexer.new
|
6
|
+
PuppetLint::Data.path = path
|
7
|
+
begin
|
8
|
+
PuppetLint::Data.manifest_lines = content.split("\n", -1)
|
9
|
+
PuppetLint::Data.tokens = lexer.tokenise(content)
|
10
|
+
PuppetLint::Data.parse_control_comments
|
11
|
+
rescue
|
12
|
+
PuppetLint::Data.tokens = []
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
3
17
|
PuppetLint.new_check(:ghostbuster_defines) do
|
4
18
|
def check
|
5
19
|
return if path.match(%r{^\./(:?[^/]+/){2}?manifests/.+$}).nil?
|
@@ -1,3 +1,17 @@
|
|
1
|
+
class PuppetLint::Checks
|
2
|
+
def load_data(path, content)
|
3
|
+
lexer = PuppetLint::Lexer.new
|
4
|
+
PuppetLint::Data.path = path
|
5
|
+
begin
|
6
|
+
PuppetLint::Data.manifest_lines = content.split("\n", -1)
|
7
|
+
PuppetLint::Data.tokens = lexer.tokenise(content)
|
8
|
+
PuppetLint::Data.parse_control_comments
|
9
|
+
rescue
|
10
|
+
PuppetLint::Data.tokens = []
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
1
15
|
PuppetLint.new_check(:ghostbuster_facts) do
|
2
16
|
def manifests
|
3
17
|
Dir.glob('./**/manifests/**/*.pp')
|
@@ -18,6 +32,7 @@ PuppetLint.new_check(:ghostbuster_facts) do
|
|
18
32
|
|
19
33
|
manifests.each do |manifest|
|
20
34
|
found = true if File.readlines(manifest).grep(%r{\$\{?::#{fact_name}\}?}).size > 0
|
35
|
+
found = true if File.readlines(manifest).grep(%r{@#{fact_name}}).size > 0
|
21
36
|
break if found
|
22
37
|
end
|
23
38
|
|
@@ -1,3 +1,17 @@
|
|
1
|
+
class PuppetLint::Checks
|
2
|
+
def load_data(path, content)
|
3
|
+
lexer = PuppetLint::Lexer.new
|
4
|
+
PuppetLint::Data.path = path
|
5
|
+
begin
|
6
|
+
PuppetLint::Data.manifest_lines = content.split("\n", -1)
|
7
|
+
PuppetLint::Data.tokens = lexer.tokenise(content)
|
8
|
+
PuppetLint::Data.parse_control_comments
|
9
|
+
rescue
|
10
|
+
PuppetLint::Data.tokens = []
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
1
15
|
PuppetLint.new_check(:ghostbuster_functions) do
|
2
16
|
def manifests
|
3
17
|
Dir.glob('./**/manifests/**/*.pp')
|
@@ -1,3 +1,17 @@
|
|
1
|
+
class PuppetLint::Checks
|
2
|
+
def load_data(path, content)
|
3
|
+
lexer = PuppetLint::Lexer.new
|
4
|
+
PuppetLint::Data.path = path
|
5
|
+
begin
|
6
|
+
PuppetLint::Data.manifest_lines = content.split("\n", -1)
|
7
|
+
PuppetLint::Data.tokens = lexer.tokenise(content)
|
8
|
+
PuppetLint::Data.parse_control_comments
|
9
|
+
rescue
|
10
|
+
PuppetLint::Data.tokens = []
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
1
15
|
PuppetLint.new_check(:ghostbuster_hiera_files) do
|
2
16
|
|
3
17
|
def regexprs
|
@@ -1,5 +1,19 @@
|
|
1
1
|
require 'puppet-ghostbuster/puppetdb'
|
2
2
|
|
3
|
+
class PuppetLint::Checks
|
4
|
+
def load_data(path, content)
|
5
|
+
lexer = PuppetLint::Lexer.new
|
6
|
+
PuppetLint::Data.path = path
|
7
|
+
begin
|
8
|
+
PuppetLint::Data.manifest_lines = content.split("\n", -1)
|
9
|
+
PuppetLint::Data.tokens = lexer.tokenise(content)
|
10
|
+
PuppetLint::Data.parse_control_comments
|
11
|
+
rescue
|
12
|
+
PuppetLint::Data.tokens = []
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
3
17
|
PuppetLint.new_check(:ghostbuster_types) do
|
4
18
|
def manifests
|
5
19
|
Dir.glob('./**/manifests/**/*.pp')
|
@@ -44,5 +44,13 @@ describe 'ghostbuster_facts' do
|
|
44
44
|
expect(problems).to have(0).problems
|
45
45
|
end
|
46
46
|
end
|
47
|
+
|
48
|
+
context 'when fact is used in an inline_template' do
|
49
|
+
let(:path) { "./spec/fixtures/modules/foo/lib/facter/quux.rb" }
|
50
|
+
|
51
|
+
it 'should not detect any problem' do
|
52
|
+
expect(problems).to have(0).problems
|
53
|
+
end
|
54
|
+
end
|
47
55
|
end
|
48
56
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puppet-ghostbuster
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Camptocamp
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-05-
|
11
|
+
date: 2016-05-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: coveralls
|
@@ -193,6 +193,7 @@ files:
|
|
193
193
|
- spec/fixtures/modules/foo/lib/facter/baz.rb
|
194
194
|
- spec/fixtures/modules/foo/lib/facter/foo.rb
|
195
195
|
- spec/fixtures/modules/foo/lib/facter/multi.rb
|
196
|
+
- spec/fixtures/modules/foo/lib/facter/quux.rb
|
196
197
|
- spec/fixtures/modules/foo/lib/puppet/parser/functions/bar.rb
|
197
198
|
- spec/fixtures/modules/foo/lib/puppet/parser/functions/baz.rb
|
198
199
|
- spec/fixtures/modules/foo/lib/puppet/parser/functions/foo.rb
|