diff --git a/Library/.rubocop_shared.yml b/Library/.rubocop_shared.yml index 32d122760..96f158902 100644 --- a/Library/.rubocop_shared.yml +++ b/Library/.rubocop_shared.yml @@ -45,9 +45,10 @@ Style/BarePercentLiterals: Style/CollectionMethods: Enabled: true -# Prefer simple tokens without type annotations. +# Prefer tokens with type annotations for consistency +# between formatting numbers and strings. Style/FormatStringToken: - EnforcedStyle: template + EnforcedStyle: annotated # This shouldn't be enabled until LineLength is lower. Style/IfUnlessModifier: diff --git a/Library/Homebrew/Gemfile b/Library/Homebrew/Gemfile index bf6f42025..0bf2f0da3 100644 --- a/Library/Homebrew/Gemfile +++ b/Library/Homebrew/Gemfile @@ -3,7 +3,7 @@ source "https://rubygems.org" # installed gems -gem "coveralls", require: false +gem "coveralls", "~> 0.8", require: false gem "parallel_tests" gem "ronn", require: false gem "rspec" @@ -12,7 +12,6 @@ gem "rspec-retry", require: false gem "rspec-wait", require: false gem "rubocop" gem "simplecov", require: false -gem "simplecov-cobertura", require: false # vendored gems gem "activesupport" diff --git a/Library/Homebrew/Gemfile.lock b/Library/Homebrew/Gemfile.lock index 2c28b60ee..508329274 100644 --- a/Library/Homebrew/Gemfile.lock +++ b/Library/Homebrew/Gemfile.lock @@ -66,7 +66,7 @@ GEM rspec-mocks (~> 3.8.0) rspec-core (3.8.2) rspec-support (~> 3.8.0) - rspec-expectations (3.8.4) + rspec-expectations (3.8.5) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.8.0) rspec-its (1.3.0) @@ -80,14 +80,14 @@ GEM rspec-support (3.8.3) rspec-wait (0.0.9) rspec (>= 3, < 4) - rubocop (0.74.0) + rubocop (0.75.0) jaro_winkler (~> 1.5.1) parallel (~> 1.10) parser (>= 2.6) rainbow (>= 2.2.2, < 4.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 1.7) - rubocop-performance (1.4.1) + rubocop-performance (1.5.0) rubocop (>= 0.71.0) rubocop-rspec (1.36.0) rubocop (>= 0.68.1) @@ -97,8 +97,6 @@ GEM docile (~> 1.1) json (>= 1.8, < 3) simplecov-html (~> 0.10.0) - simplecov-cobertura (1.3.1) - simplecov (~> 0.8) simplecov-html (0.10.2) term-ansicolor (1.7.1) tins (~> 1.0) @@ -120,7 +118,7 @@ DEPENDENCIES activesupport backports concurrent-ruby - coveralls + coveralls (~> 0.8) mechanize parallel_tests plist @@ -134,7 +132,6 @@ DEPENDENCIES rubocop-rspec ruby-macho simplecov - simplecov-cobertura BUNDLED WITH - 2.0.1 + 2.0.2 diff --git a/Library/Homebrew/cmd/info.rb b/Library/Homebrew/cmd/info.rb index 01e3ca541..a17980a22 100644 --- a/Library/Homebrew/cmd/info.rb +++ b/Library/Homebrew/cmd/info.rb @@ -410,6 +410,6 @@ module Homebrew end def format_percent(percent) - format "%.2f", percent + format("%.2f", percent: percent) end end diff --git a/Library/Homebrew/debrew.rb b/Library/Homebrew/debrew.rb index f3827b964..33209cffe 100644 --- a/Library/Homebrew/debrew.rb +++ b/Library/Homebrew/debrew.rb @@ -88,7 +88,7 @@ module Debrew def self.debrew @active = true - Object.send(:include, Raise) + Object.include Raise begin yield diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb index 896cd2a4a..9af74e538 100644 --- a/Library/Homebrew/dev-cmd/audit.rb +++ b/Library/Homebrew/dev-cmd/audit.rb @@ -254,7 +254,7 @@ module Homebrew wanted_mode = 0100644 & ~File.umask actual_mode = formula.path.stat.mode unless actual_mode == wanted_mode - problem format("Incorrect file permissions (%03o): chmod %03o %{path}", + problem format("Incorrect file permissions (%03o): chmod %03o %s", actual: actual_mode & 0777, wanted: wanted_mode & 0777, path: formula.path) diff --git a/Library/Homebrew/dev-cmd/bottle.rb b/Library/Homebrew/dev-cmd/bottle.rb index 534d66721..51b597ce7 100644 --- a/Library/Homebrew/dev-cmd/bottle.rb +++ b/Library/Homebrew/dev-cmd/bottle.rb @@ -530,14 +530,13 @@ module Homebrew unless args.no_commit? if ENV["HOMEBREW_GIT_NAME"] - ENV["GIT_AUTHOR_NAME"] = - ENV["GIT_COMMITTER_NAME"] = - ENV["HOMEBREW_GIT_NAME"] + ENV["GIT_AUTHOR_NAME"] = ENV["GIT_COMMITTER_NAME"] = + ENV["HOMEBREW_GIT_NAME"] end + if ENV["HOMEBREW_GIT_EMAIL"] - ENV["GIT_AUTHOR_EMAIL"] = - ENV["GIT_COMMITTER_EMAIL"] = - ENV["HOMEBREW_GIT_EMAIL"] + ENV["GIT_AUTHOR_EMAIL"] = ENV["GIT_COMMITTER_EMAIL"] = + ENV["HOMEBREW_GIT_EMAIL"] end short_name = formula_name.split("/", -1).last diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 3e22bd8d1..a59171592 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -1843,7 +1843,7 @@ class Formula @exec_count ||= 0 @exec_count += 1 - logfn = format("#{logs}/#{active_log_prefix}%02d.%{cmd_base}", + logfn = format("#{logs}/#{active_log_prefix}%02d.%s", exec_count: @exec_count, cmd_base: File.basename(cmd).split(" ").first) logs.mkpath diff --git a/Library/Homebrew/messages.rb b/Library/Homebrew/messages.rb index 664fd50d3..d0b371a2e 100644 --- a/Library/Homebrew/messages.rb +++ b/Library/Homebrew/messages.rb @@ -40,7 +40,7 @@ class Messages oh1 "Installation times" install_times.each do |t| - puts format("%-20s %10.3f s", t[:formula], t[:time]) + puts format("%-20s %