style: use RuboCop 0.41.2, adjust defaults (#489)
Changes to our style configuration: - Consolidate all rules related to Ruby 1.8 compatibility in one place. - Codify our de-facto preference for `alias_method` over `alias` (drops offense count by 54 after turning this on). - Drop `Style/SignalException` as `only_raise` has been the new default for quite a while (since RuboCop 0.37.0).
This commit is contained in:
parent
842862c653
commit
768ba34b14
@ -3,9 +3,13 @@ AllCops:
|
||||
- 'Homebrew/vendor/**/*'
|
||||
- 'Homebrew/test/vendor/**/*'
|
||||
|
||||
# 1.8-style hash keys
|
||||
# Ruby 1.8 compatibility
|
||||
Style/DotPosition:
|
||||
EnforcedStyle: trailing
|
||||
Style/HashSyntax:
|
||||
EnforcedStyle: hash_rockets
|
||||
Style/TrailingCommaInArguments:
|
||||
EnforcedStyleForMultiline: no_comma
|
||||
|
||||
# ruby style guide favorite
|
||||
Style/StringLiterals:
|
||||
@ -23,6 +27,10 @@ Style/CommandLiteral:
|
||||
Style/RegexpLiteral:
|
||||
EnforcedStyle: slashes
|
||||
|
||||
# too prevalent to change this now, but might be discussed/changed later
|
||||
Style/Alias:
|
||||
EnforcedStyle: prefer_alias_method
|
||||
|
||||
# our current conditional style is established, clear and
|
||||
# requiring users to change that now would be confusing.
|
||||
Style/ConditionalAssignment:
|
||||
@ -115,10 +123,6 @@ Style/WordArray:
|
||||
Style/UnneededCapitalW:
|
||||
Enabled: false
|
||||
|
||||
# we use raise, not fail
|
||||
Style/SignalException:
|
||||
EnforcedStyle: only_raise
|
||||
|
||||
# we prefer compact if-else-end/case-when-end alignment
|
||||
Lint/EndAlignment:
|
||||
AlignWith: variable
|
||||
@ -129,12 +133,6 @@ Style/CaseIndentation:
|
||||
Style/PerlBackrefs:
|
||||
Enabled: false
|
||||
|
||||
# this is required for Ruby 1.8
|
||||
Style/DotPosition:
|
||||
EnforcedStyle: trailing
|
||||
|
||||
# makes diffs nicer
|
||||
Style/TrailingCommaInArguments:
|
||||
EnforcedStyleForMultiline: no_comma
|
||||
Style/TrailingCommaInLiteral:
|
||||
EnforcedStyleForMultiline: comma
|
||||
|
||||
@ -47,7 +47,7 @@ module Homebrew
|
||||
|
||||
def check_style_impl(files, output_type, options = {})
|
||||
fix = options[:fix]
|
||||
Homebrew.install_gem_setup_path! "rubocop", "0.41.1"
|
||||
Homebrew.install_gem_setup_path! "rubocop", "0.41.2"
|
||||
|
||||
args = %W[
|
||||
--force-exclusion
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user