Correct the Rakefile's lint target for the new local-modules tree
This commit is contained in:
parent
e264899063
commit
a0e0ba395d
31
Rakefile
31
Rakefile
|
@ -2,24 +2,9 @@ require 'puppet-lint/tasks/puppet-lint'
|
|||
|
||||
PuppetLint.configuration.send('disable_names_containing_dash')
|
||||
PuppetLint.configuration.send('disable_80chars')
|
||||
PuppetLint.configuration.send('disable_documentation')
|
||||
|
||||
|
||||
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" }
|
||||
PuppetLint.configuration.ignore_paths = ["modules/**/*.pp"]
|
||||
|
||||
|
||||
def each_manifest(&block)
|
||||
|
@ -27,19 +12,9 @@ def each_manifest(&block)
|
|||
yield filename
|
||||
end
|
||||
|
||||
Dir.glob("modules/**/*.pp") do |filename|
|
||||
found = false
|
||||
ignored_modules.each do |ignore|
|
||||
if filename.start_with? ignore
|
||||
found = true
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
unless found
|
||||
Dir.glob("local-modules/**/*.pp") do |filename|
|
||||
yield filename
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue