diff --git a/Library/.rubocop.yml b/Library/.rubocop.yml index cb065a1a4b..dd6e039b09 100644 --- a/Library/.rubocop.yml +++ b/Library/.rubocop.yml @@ -1,5 +1,5 @@ AllCops: - TargetRubyVersion: 2.0 + TargetRubyVersion: 2.3 Exclude: - '**/Casks/**/*' - '**/vendor/**/*' @@ -119,7 +119,7 @@ Style/Encoding: Enabled: true # dashes in filenames are typical -Style/FileName: +Naming/FileName: Regex: !ruby/regexp /^[\w\@\-\+\.]+(\.rb)?$/ # falsely flags e.g. curl formatting arguments as format strings @@ -189,8 +189,25 @@ Style/TrailingCommaInArguments: EnforcedStyleForMultiline: comma # we have too many variables like sha256 where this harms readability -Style/VariableNumber: +Naming/VariableNumber: Enabled: false Style/WordArray: MinSize: 4 + +# we want to add this slowly and manually +Style/FrozenStringLiteralComment: + Enabled: false + +# generally rescuing StandardError is fine +Lint/RescueWithoutErrorClass: + Enabled: false + +# implicitly allow EOS as we use it everywhere +Naming/HeredocDelimiterNaming: + Blacklist: + - END, EOD, EOF + +# we output how to use interpolated strings too often +Lint/InterpolationCheck: + Enabled: false diff --git a/Library/Homebrew/.rubocop.yml b/Library/Homebrew/.rubocop.yml index 26c9445294..dc44065277 100644 --- a/Library/Homebrew/.rubocop.yml +++ b/Library/Homebrew/.rubocop.yml @@ -42,12 +42,12 @@ Style/HashSyntax: EnforcedStyle: ruby19_no_mixed_keys # we won't change backward compatible method names -Style/MethodName: +Naming/MethodName: Exclude: - 'compat/**/*' # we won't change backward compatible predicate names -Style/PredicateName: +Naming/PredicateName: Exclude: - 'compat/**/*' NameWhitelist: is_32_bit?, is_64_bit? diff --git a/Library/Homebrew/.rubocop_todo.yml b/Library/Homebrew/.rubocop_todo.yml index 37518a5f0a..96c2f3676c 100644 --- a/Library/Homebrew/.rubocop_todo.yml +++ b/Library/Homebrew/.rubocop_todo.yml @@ -81,7 +81,7 @@ Security/MarshalLoad: - 'utils/fork.rb' # Offense count: 1 -Style/AccessorMethodName: +Naming/AccessorMethodName: Exclude: - 'extend/ENV/super.rb' @@ -136,10 +136,3 @@ Style/MutableConstant: - 'formulary.rb' - 'tab.rb' - 'tap.rb' - -# Offense count: 8 -Style/OpMethod: - Exclude: - - 'dependencies.rb' - - 'install_renamed.rb' - - 'options.rb' diff --git a/Library/Homebrew/constants.rb b/Library/Homebrew/constants.rb index 23be70bccf..b122946c8f 100644 --- a/Library/Homebrew/constants.rb +++ b/Library/Homebrew/constants.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # RuboCop version used for `brew style` and `brew cask style` -HOMEBREW_RUBOCOP_VERSION = "0.49.1".freeze -HOMEBREW_RUBOCOP_CASK_VERSION = "~> 0.13.1".freeze # has to be updated when RuboCop version changes +HOMEBREW_RUBOCOP_VERSION = "0.50.0" +HOMEBREW_RUBOCOP_CASK_VERSION = "~> 0.14.2" # has to be updated when RuboCop version changes diff --git a/Library/Homebrew/os/mac.rb b/Library/Homebrew/os/mac.rb index 52fa2a1873..d3e5cb38ca 100644 --- a/Library/Homebrew/os/mac.rb +++ b/Library/Homebrew/os/mac.rb @@ -11,7 +11,7 @@ module OS module Mac module_function - ::MacOS = self # rubocop:disable Style/ConstantName + ::MacOS = self # rubocop:disable Naming/ConstantName raise "Loaded OS::Mac on generic OS!" if ENV["HOMEBREW_TEST_GENERIC_OS"]