lib/istanbul/plugin.rb in danger-istanbul-0.0.3 vs lib/istanbul/plugin.rb in danger-istanbul-0.0.4
- old
+ new
@@ -77,13 +77,19 @@
end
puts "Verificando coverege de cada arquivo do pull request > #{min_coverage_for_file}" if verbose
data[:childrens].select{|a| php_files.include?(a[:file])}.each do |file_coverage|
if file_coverage[:coverage] < min_coverage_for_file
- fail("#{file_coverage[:file]} coverage abaixo de #{min_coverage_for_file}%. Coverage atual: #{file_coverage[:coverage]}%")
+ fail("#{generate_link(file_coverage[:file])} coverage abaixo de #{min_coverage_for_file}%. Coverage atual: #{file_coverage[:coverage]}%")
end
end
+ end
+
+ def generate_link(file)
+ branch = github.branch_for_head
+ final_link = "../blob/#{branch}/#{file}"
+ "<a href='#{final_link}' title='#{file}' target='_blank'>#{file.split('/').last}</a>"
end
private
def round(number)