Class: HamlLint::Reporter::GithubReporter
- Inherits:
-
HamlLint::Reporter
- Object
- HamlLint::Reporter
- HamlLint::Reporter::GithubReporter
- 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 =
Characters to escape within a command message.
{ '%' => '%25', "\n" => '%0A', "\r" => '%0D' }.freeze
- PROPERTY_ESCAPE_MAP =
Property values also escape the ‘:` and `,` that delimit the command.
ESCAPE_MAP.merge(':' => '%3A', ',' => '%2C').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
Constructor Details
This class inherits a constructor from HamlLint::Reporter
Instance Method Details
#added_lint(lint, report) ⇒ Object
13 14 15 16 |
# File 'lib/haml_lint/reporter/github_reporter.rb', line 13 def added_lint(lint, report) severity = lint.severity >= report.fail_level ? 'error' : 'warning' print_workflow_command(lint, severity) 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 |