Skip to content

Instantly share code, notes, and snippets.

Created December 3, 2019 21:18
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save clupprich/6a707ba3cef5c230a2dab1ea0897030a to your computer and use it in GitHub Desktop.
# Use it like so:
# > bundle exec {rubocop, standardrb} --require ./lib/github_actions_formatter.rb --format GithubActionsFormatter
class GithubActionsFormatter < RuboCop::Formatter::BaseFormatter
def file_finished(file, offenses)
return unless (uncorrected_offenses = offenses.reject(&:corrected?)).any?
uncorrected_offenses.each do |o|
output.printf("::error file=%s,line=%d,col=%d::%s\n", path_to(file), o.line, o.real_column,"\n", " "))
def path_to(file)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment