Skip to content

Instantly share code, notes, and snippets.

@danbarua
Created February 10, 2014 13:26
Show Gist options
  • Save danbarua/8915901 to your computer and use it in GitHub Desktop.
Save danbarua/8915901 to your computer and use it in GitHub Desktop.
Albacore task to verify projects have StyleCop.MSBuild set up properly
desc "Checks .csproj files for StyleCop.MSBuild target"
task :verify_stylecop_msbuild do
projectFiles = FileList["./**/*.csproj"]
projectFiles.each{|f|
doc = Nokogiri::XML(File.open(f))
target = doc.css('PropertyGroup > StyleCopMSBuildTargetsFile')
if (target.empty?)
puts "#{f} has no stylecop.msbuild"
else
puts "#{f} is ok"
end
}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment