Sha256: d691f65d5adf9e03b8714dc00b5b2326d37a3b8926dc1ce89d6a6534f3daef35
Contents?: true
Size: 1016 Bytes
Versions: 8
Compression:
Stored size: 1016 Bytes
Contents
# frozen_string_literal: true require 'colorized_string' require_relative 'base' # TODO: test output format module AxR module Formatters class Default < Base DOT = '.' STAR = '*' def single_file(scanner, _file_path) if scanner.warnings.any? STDOUT.print ColorizedString[STAR].colorize(:yellow) else STDOUT.print ColorizedString[DOT].colorize(:green) end end def summary(scanned_files, files_with_warnings) STDOUT.puts STDOUT.puts issues_amount = 0 files_with_warnings.each_pair do |file_path, warnings| warnings.each do |warning| issues_amount += 1 msg = "#{file_path}:#{warning.loc_num} # => #{warning.message}" STDOUT.puts ColorizedString[msg].colorize(:yellow) end end STDOUT.puts STDOUT.puts STDOUT.puts("#{scanned_files.size} files scanned. #{issues_amount} issues detected") end end end end
Version data entries
8 entries across 8 versions & 1 rubygems