Last active
August 29, 2015 14:00
-
-
Save Sharpie/11277458 to your computer and use it in GitHub Desktop.
A simple YARD linter that prints out the names of files with issues
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'open3' | |
stdout, stderr, status = Open3.capture3 'inch' | |
lint = {} | |
FILE_REGEX = /\[debug\]: (Parsing|Re-processing) ([^[:blank:]]*\.rb)[\.]*$/ | |
current_file = nil | |
stdout.each_line do |line| | |
if ( match = FILE_REGEX.match(line) ) | |
current_file = match.captures[1] | |
lint[current_file] ||= [] | |
else | |
lint[current_file] << line unless current_file.nil? | |
end | |
end | |
lint.reject!{|_, v| v.empty?} | |
lint.keys.sort.each do |key| | |
puts key | |
lint[key].each {|l| puts "\t" + l } | |
puts "\n" | |
end | |
puts "Total Files With Issues: #{lint.length}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment