Class: RuboCop::Formatter::GitHubActionsFormatter
Overview
This formatter formats report data as GitHub Workflow commands resulting in GitHub check annotations when run within GitHub Actions.
Constant Summary
collapse
- ESCAPE_MAP =
{ '%' => '%25', "\n" => '%0A', "\r" => '%0D' }.freeze
Instance Attribute Summary
#options, #output
Instance Method Summary
collapse
#file_started, #initialize
Instance Method Details
#file_finished(file, offenses) ⇒ Object
14
15
16
|
# File 'lib/rubocop/formatter/github_actions_formatter.rb', line 14
def file_finished(file, offenses)
@offenses_for_files[file] = offenses unless offenses.empty?
end
|
#finished(_inspected_files) ⇒ Object
18
19
20
21
22
23
24
25
|
# File 'lib/rubocop/formatter/github_actions_formatter.rb', line 18
def finished(_inspected_files)
@offenses_for_files.each do |file, offenses|
offenses.each do |offense|
report_offense(file, offense)
end
end
output.puts
end
|
#started(_target_files) ⇒ Object
10
11
12
|
# File 'lib/rubocop/formatter/github_actions_formatter.rb', line 10
def started(_target_files)
@offenses_for_files = {}
end
|