diff options
Diffstat (limited to 'Library/Homebrew')
| -rw-r--r-- | Library/Homebrew/.rubocop.yml | 14 | ||||
| -rw-r--r-- | Library/Homebrew/cask/lib/hbc/cli/style.rb | 3 | ||||
| -rw-r--r-- | Library/Homebrew/cmd/style.rb | 12 | ||||
| -rw-r--r-- | Library/Homebrew/constants.rb | 4 | ||||
| -rw-r--r-- | Library/Homebrew/dev-cmd/tests.rb | 4 | ||||
| -rw-r--r-- | Library/Homebrew/extend/string.rb | 1 | ||||
| -rw-r--r-- | Library/Homebrew/test/Gemfile.lock | 3 |
7 files changed, 23 insertions, 18 deletions
diff --git a/Library/Homebrew/.rubocop.yml b/Library/Homebrew/.rubocop.yml index 4158f9f64..26c944529 100644 --- a/Library/Homebrew/.rubocop.yml +++ b/Library/Homebrew/.rubocop.yml @@ -9,9 +9,8 @@ AllCops: - '**/Casks/**/*' - '**/vendor/**/*' -Style/BlockDelimiters: +Layout/MultilineMethodCallIndentation: Exclude: - - '**/cask/spec/**/*' - '**/*_spec.rb' # so many of these in formulae but none in here @@ -27,16 +26,13 @@ Lint/NestedMethodDefinition: Lint/ParenthesesAsGroupedExpression: Enabled: true -Metrics/ModuleLength: - CountComments: false - Exclude: - - 'cask/lib/hbc/locations.rb' - - 'cask/lib/hbc/macos.rb' - - 'cask/lib/hbc/utils.rb' - Metrics/ParameterLists: CountKeywordArgs: false +Style/BlockDelimiters: + Exclude: + - '**/*_spec.rb' + # so many of these in formulae but none in here Style/GuardClause: Enabled: true diff --git a/Library/Homebrew/cask/lib/hbc/cli/style.rb b/Library/Homebrew/cask/lib/hbc/cli/style.rb index 03159a0cf..97208232b 100644 --- a/Library/Homebrew/cask/lib/hbc/cli/style.rb +++ b/Library/Homebrew/cask/lib/hbc/cli/style.rb @@ -11,7 +11,8 @@ module Hbc def run install_rubocop - system({ "XDG_CACHE_HOME" => HOMEBREW_CACHE }, "rubocop", *rubocop_args, "--", *cask_paths) + cache_env = { "XDG_CACHE_HOME" => "#{HOMEBREW_CACHE}/style" } + system(cache_env, "rubocop", *rubocop_args, "--", *cask_paths) raise CaskError, "style check failed" unless $CHILD_STATUS.success? true end diff --git a/Library/Homebrew/cmd/style.rb b/Library/Homebrew/cmd/style.rb index 228aa360e..e469c47bb 100644 --- a/Library/Homebrew/cmd/style.rb +++ b/Library/Homebrew/cmd/style.rb @@ -73,7 +73,11 @@ module Homebrew args = %w[ --force-exclusion ] - args << "--auto-correct" if fix + if fix + args << "--auto-correct" + else + args << "--parallel" + end if options[:except_cops] options[:except_cops].map! { |cop| RuboCop::Cop::Cop.registry.qualified_cop_name(cop.to_s, "") } @@ -101,14 +105,16 @@ module Homebrew args += files end + cache_env = { "XDG_CACHE_HOME" => "#{HOMEBREW_CACHE}/style" } + case output_type when :print args << "--display-cop-names" if ARGV.include? "--display-cop-names" args << "--format" << "simple" if files - system({ "XDG_CACHE_HOME" => HOMEBREW_CACHE }, "rubocop", *args) + system(cache_env, "rubocop", *args) !$?.success? when :json - json, _, status = Open3.capture3({ "XDG_CACHE_HOME" => HOMEBREW_CACHE }, "rubocop", "--format", "json", *args) + json, _, status = Open3.capture3(cache_env, "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 diff --git a/Library/Homebrew/constants.rb b/Library/Homebrew/constants.rb index 827d5827f..4ccf18624 100644 --- a/Library/Homebrew/constants.rb +++ b/Library/Homebrew/constants.rb @@ -1,3 +1,3 @@ # RuboCop version used for `brew style` and `brew cask style` -HOMEBREW_RUBOCOP_VERSION = "0.47.1".freeze -HOMEBREW_RUBOCOP_CASK_VERSION = "~> 0.12.0".freeze # has to be updated when RuboCop version changes +HOMEBREW_RUBOCOP_VERSION = "0.49.1".freeze +HOMEBREW_RUBOCOP_CASK_VERSION = "~> 0.13.0".freeze # has to be updated when RuboCop version changes diff --git a/Library/Homebrew/dev-cmd/tests.rb b/Library/Homebrew/dev-cmd/tests.rb index d90326768..f434868b6 100644 --- a/Library/Homebrew/dev-cmd/tests.rb +++ b/Library/Homebrew/dev-cmd/tests.rb @@ -91,12 +91,12 @@ module Homebrew end args = ["-I", HOMEBREW_LIBRARY_PATH/"test"] - args += %w[ + args += %W[ --color --require spec_helper --format progress --format ParallelTests::RSpec::RuntimeLogger - --out tmp/parallel_runtime_rspec.log + --out #{HOMEBREW_CACHE}/tests/parallel_runtime_rspec.log ] args << "--seed" << ARGV.next if ARGV.include? "--seed" diff --git a/Library/Homebrew/extend/string.rb b/Library/Homebrew/extend/string.rb index 162666d2d..809242db9 100644 --- a/Library/Homebrew/extend/string.rb +++ b/Library/Homebrew/extend/string.rb @@ -2,6 +2,7 @@ class String def undent gsub(/^[ \t]{#{(slice(/^[ \t]+/) || '').length}}/, "") end + alias unindent undent # eg: # if foo then <<-EOS.undent_________________________________________________________72 diff --git a/Library/Homebrew/test/Gemfile.lock b/Library/Homebrew/test/Gemfile.lock index 1f6adae93..ccfd91542 100644 --- a/Library/Homebrew/test/Gemfile.lock +++ b/Library/Homebrew/test/Gemfile.lock @@ -36,7 +36,8 @@ GEM rspec-support (3.6.0) rspec-wait (0.0.9) rspec (>= 3, < 4) - rubocop (0.48.1) + rubocop (0.49.1) + parallel (~> 1.10) parser (>= 2.3.3.1, < 3.0) powerpack (~> 0.1) rainbow (>= 1.99.1, < 3.0) |
