Correct the Rakefile's lint target for the new local-modules tree

This commit is contained in:
R. Tyler Croy 2013-06-30 20:10:38 -07:00
parent e264899063
commit a0e0ba395d
1 changed files with 4 additions and 29 deletions

View File

@ -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,18 +12,8 @@ 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
yield filename
end
Dir.glob("local-modules/**/*.pp") do |filename|
yield filename
end
end