Correct the Rakefile's lint target for the new local-modules tree
This commit is contained in:
parent
e264899063
commit
a0e0ba395d
33
Rakefile
33
Rakefile
|
@ -2,24 +2,9 @@ require 'puppet-lint/tasks/puppet-lint'
|
||||||
|
|
||||||
PuppetLint.configuration.send('disable_names_containing_dash')
|
PuppetLint.configuration.send('disable_names_containing_dash')
|
||||||
PuppetLint.configuration.send('disable_80chars')
|
PuppetLint.configuration.send('disable_80chars')
|
||||||
|
PuppetLint.configuration.send('disable_documentation')
|
||||||
|
|
||||||
|
PuppetLint.configuration.ignore_paths = ["modules/**/*.pp"]
|
||||||
def ignored_modules
|
|
||||||
##
|
|
||||||
## We're going to ignore all the submodules, since we don't really care how
|
|
||||||
## crappy their code is
|
|
||||||
ignores = []
|
|
||||||
regex = /(".*?")/
|
|
||||||
File.open('.gitmodules').each_line do |line|
|
|
||||||
matches = line.match(regex)
|
|
||||||
if matches
|
|
||||||
ignores << matches[1].gsub('"', '')
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return ignores
|
|
||||||
end
|
|
||||||
|
|
||||||
PuppetLint.configuration.ignore_paths = ignored_modules.map { |p| "#{p}/**/*.pp" }
|
|
||||||
|
|
||||||
|
|
||||||
def each_manifest(&block)
|
def each_manifest(&block)
|
||||||
|
@ -27,18 +12,8 @@ def each_manifest(&block)
|
||||||
yield filename
|
yield filename
|
||||||
end
|
end
|
||||||
|
|
||||||
Dir.glob("modules/**/*.pp") do |filename|
|
Dir.glob("local-modules/**/*.pp") do |filename|
|
||||||
found = false
|
yield filename
|
||||||
ignored_modules.each do |ignore|
|
|
||||||
if filename.start_with? ignore
|
|
||||||
found = true
|
|
||||||
break
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
unless found
|
|
||||||
yield filename
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue