Skip to content

Commit

Permalink
“Reformat Document”: Support new RuboCop version
Browse files Browse the repository at this point in the history
The latest version of `rubocop` does not support the flag `-n` anymore
([1]).

[1]: rubocop/rubocop#4168
  • Loading branch information
sanssecours committed Apr 20, 2017
1 parent bbb2226 commit 996915c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Support/lib/rubocop.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,9 @@ def locate_rubocop
end

def format_file(rubocop, unsaved_file)
aha = `which aha`.rstrip
aha = `which aha`.rstrip.match(/.+/)
output_format = aha ? :html : :text
command = "#{rubocop} -a#{'n' if aha} \"$TM_FILEPATH\"" \
"#{' | aha' if aha} 2>&1"
command = "#{rubocop} -a \"$TM_FILEPATH\" #{'--color | aha' if aha} 2>&1"
if unsaved_file
format_unsaved(command, output_format)
else
Expand Down

0 comments on commit 996915c

Please sign in to comment.