class HamlLint::Reporter::GithubReporter

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

Constants

ESCAPE_MAP

Public Instance Methods

added_lint(lint, report) click to toggle source
# 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) click to toggle source
# File lib/haml_lint/reporter/github_reporter.rb, line 18
def display_report(report)
  print_summary(report)
end

Private Instance Methods

github_escape(string) click to toggle source
# File lib/haml_lint/reporter/github_reporter.rb, line 28
def github_escape(string)
  string.gsub(Regexp.union(ESCAPE_MAP.keys), ESCAPE_MAP)
end
print_workflow_command(lint:, severity: 'error') click to toggle source