Skip to content

Instantly share code, notes, and snippets.

@tkfm-yamaguchi
Created November 15, 2018 05:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tkfm-yamaguchi/04272db5888dd9e7bc2cbdbe5383e64e to your computer and use it in GitHub Desktop.
Save tkfm-yamaguchi/04272db5888dd9e7bc2cbdbe5383e64e to your computer and use it in GitHub Desktop.
formatter for rubocop: output relative path with emacs style
module RuboCop
module Formatter
class EmacsStyleFormatter < BaseFormatter
def file_finished_with_relative_path(file, offenses)
path = Pathname(file).relative_path_from(Pathname.pwd).to_s
file_finished_without_relative_path(path, offenses)
end
alias file_finished_without_relative_path file_finished
alias file_finished file_finished_with_relative_path
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment