Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
quick&dirty script for finding commits where tests weren't done
require 'rubygems'
dir = '/Users/evizitei/Code/instructure/canvas-lms'
Dir.chdir dir
shas =`git log --oneline --since='4 weeks ago' | cut -f 1 -d ' '`
def is_a_problem?(sha)
files = (`git diff --name-only #{sha} #{sha}~1`)
((files =~ /^(app|public).*\.(coffee|js)$/ &&
!(files =~ /^spec.*\.(coffee|js)$/)) ||
(files =~ /^(app|lib).*\.rb$/ && !(files =~ /^spec.*\.rb$/) ))
end
problems = shas.split(/\n/).select{|sha| is_a_problem?(sha) }
puts "FOUND #{problems.count} problems"
File.open("problems.txt", 'w') do |f|
problems.each{|p| f << p << "\n"}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.