diff options
| author | Markus Reiter | 2016-09-28 22:47:14 +0200 |
|---|---|---|
| committer | Markus Reiter | 2016-09-29 22:58:41 +0200 |
| commit | 18a9945ad8aa3bbe71512d1422e562ef3eee3ee5 (patch) | |
| tree | 1d9006b5d9c1d5e8441ab91fc255629ab0bd7e68 /Library/Homebrew/cmd | |
| parent | 5800f2f084fa59d073a4793b0fb77630f12b2bab (diff) | |
| download | brew-18a9945ad8aa3bbe71512d1422e562ef3eee3ee5.tar.bz2 | |
`cd` to `HOMEBREW_LIBRARY` is not needed anymore for RuboCop.
Diffstat (limited to 'Library/Homebrew/cmd')
| -rw-r--r-- | Library/Homebrew/cmd/style.rb | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/Library/Homebrew/cmd/style.rb b/Library/Homebrew/cmd/style.rb index d396f81ee..e44641f70 100644 --- a/Library/Homebrew/cmd/style.rb +++ b/Library/Homebrew/cmd/style.rb @@ -56,26 +56,25 @@ module Homebrew args << "--config" << HOMEBREW_LIBRARY_PATH/".rubocop.yml" args += [HOMEBREW_LIBRARY_PATH] else - args << "--config" << HOMEBREW_LIBRARY/"Taps/.rubocop.yml" + args << "--config" << Tap::TAP_DIRECTORY/".rubocop.yml" + args << "--format" << "simple" args += files end - HOMEBREW_LIBRARY.cd do - case output_type - when :print - args << "--display-cop-names" if ARGV.include? "--display-cop-names" - system "rubocop", "--format", "simple", *args - !$?.success? - when :json - json = Utils.popen_read_text("rubocop", "--format", "json", *args) - # exit status of 1 just means violations were found; other numbers mean execution errors - # exitstatus can also be nil if RuboCop process crashes, e.g. due to - # native extension problems - raise "Error while running RuboCop" if $?.exitstatus.nil? || $?.exitstatus > 1 - RubocopResults.new(Utils::JSON.load(json)) - else - raise "Invalid output_type for check_style_impl: #{output_type}" - end + case output_type + when :print + args << "--display-cop-names" if ARGV.include? "--display-cop-names" + system "rubocop", *args + !$?.success? + when :json + json = Utils.popen_read_text("rubocop", "--format", "json", *args) + # exit status of 1 just means violations were found; other numbers mean execution errors + # exitstatus can also be nil if RuboCop process crashes, e.g. due to + # native extension problems + raise "Error while running RuboCop" if $?.exitstatus.nil? || $?.exitstatus > 1 + RubocopResults.new(Utils::JSON.load(json)) + else + raise "Invalid output_type for check_style_impl: #{output_type}" end end |
