Class: Codeowners::Reporter
- Inherits:
-
Object
- Object
- Codeowners::Reporter
- Defined in:
- lib/codeowners/reporter.rb
Overview
This class is responsible for print the reports
Constant Summary collapse
- LABELS =
{ missing_ref: 'No owner defined', useless_pattern: 'Useless patterns', invalid_owner: 'Invalid owner', unrecognized_line: 'Unrecognized line' }.freeze
Class Method Summary collapse
- .print(*args) ⇒ Object
- .print_delimiter_line(error_type) ⇒ Object
- .print_error(error_type, inconsistencies, meta) ⇒ Object
Class Method Details
.print(*args) ⇒ Object
27 28 29 |
# File 'lib/codeowners/reporter.rb', line 27 def print(*args) puts(*args) end |
.print_delimiter_line(error_type) ⇒ Object
14 15 16 17 18 |
# File 'lib/codeowners/reporter.rb', line 14 def print_delimiter_line(error_type) raise ArgumentError, "unknown error type '#{error_type}'" unless LABELS.key?(error_type) print('-' * 30, LABELS[error_type], '-' * 30) end |
.print_error(error_type, inconsistencies, meta) ⇒ Object
20 21 22 23 24 25 |
# File 'lib/codeowners/reporter.rb', line 20 def print_error(error_type, inconsistencies, ) case error_type when :invalid_owner then print("#{inconsistencies} MISSING: #{.join(', ')}") else print(inconsistencies.to_s) end end |