require 'pluginscan/printer' require 'pluginscan/reports/issues_report/issues_printer/file_issues_printer' require 'pluginscan/reports/issues_report/issues_printer/check_findings_printer' require 'pluginscan/reports/issues_report/issues_printer/finding_printer' module Pluginscan class IssuesPrinter < Printer def initialize(hide_ignores, output = $stdout) @hide_ignores = hide_ignores @output = output end def print(data) issues = data[:issues] file_count = data[:file_count] print_headline(issues, file_count) print_results(issues) end private def print_headline(issues, file_count) @output.puts "Scanned #{issues.scanned_files_count} out of #{file_count} files and found #{issues.found_problems_count} things:".color(:blue) end def print_results(issues) printer = FileIssuesPrinter.new(@hide_ignores, @output) issues.each do |file, findings| findings = findings.reject(&:all_ignored?) if @hide_ignores printer.print(file, findings) end end end end