Class: HamlLint::Reporter::GithubReporter

Inherits:
HamlLint::Reporter show all
Includes:
Utils
Defined in:
lib/haml_lint/reporter/github_reporter.rb

Overview

Outputs GitHub workflow commands for GitHub check annotations when run within GitHub actions.

Constant Summary collapse

ESCAPE_MAP =
{ '%' => '%25', "\n" => '%0A', "\r" => '%0D' }.freeze

Instance Method Summary collapse

Methods included from Utils

#pluralize, #print_lint, #print_location, #print_message, #print_summary, #print_summary_corrected_lints, #print_summary_files, #print_summary_lints, #print_type

Methods inherited from HamlLint::Reporter

available, available?, cli_name, descendants, inherited, #initialize

Methods included from Hooks

#finished_file, #start

Constructor Details

This class inherits a constructor from HamlLint::Reporter

Instance Method Details

#added_lint(lint, report) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/haml_lint/reporter/github_reporter.rb', line 10

def added_lint(lint, report)
  if lint.severity >= report.fail_level
    print_workflow_command(lint: lint)
  else
    print_workflow_command(severity: 'warning', lint: lint)
  end
end

#display_report(report) ⇒ Object



18
19
20
# File 'lib/haml_lint/reporter/github_reporter.rb', line 18

def display_report(report)
  print_summary(report)
end