rubocop: adjust rules.

This commit is contained in:
Mike McQuaid 2020-03-13 21:14:24 +00:00
parent db121c7b17
commit 4498303f9a
No known key found for this signature in database
GPG Key ID: 48A898132FD8EE70
3 changed files with 17 additions and 24 deletions

View File

@ -21,10 +21,6 @@ Layout/HashAlignment:
Layout/ArgumentAlignment:
Enabled: false
# favour parens-less DSL-style arguments
Lint/AmbiguousOperator:
Enabled: false
# this is a bit less "floaty"
Layout/CaseIndentation:
EnforcedStyle: end
@ -37,8 +33,7 @@ Layout/EndAlignment:
Layout/SpaceAroundOperators:
Enabled: false
# Auto-correct is broken (https://github.com/rubocop-hq/rubocop/issues/6258)
# and layout is not configurable (https://github.com/rubocop-hq/rubocop/issues/6254).
# layout is not configurable (https://github.com/rubocop-hq/rubocop/issues/6254).
Layout/RescueEnsureAlignment:
Enabled: false
@ -51,15 +46,6 @@ Lint/AmbiguousBlockAssociation:
Lint/AmbiguousRegexpLiteral:
Enabled: false
# assignment in conditions are useful sometimes
# TODO: add parentheses for these and remove
Lint/AssignmentInCondition:
Enabled: false
# we output how to use interpolated strings too often
Lint/InterpolationCheck:
Enabled: false
# so many of these in formulae and can't be autocorrected
Lint/ParenthesesAsGroupedExpression:
Enabled: false
@ -84,11 +70,6 @@ Layout/LineLength:
# ignore manpage comments and long single-line strings
IgnoredPatterns: ['#: ', ' url "', ' mirror "', ' plist_options :']
# our current conditional style is established
# TODO: enable this when possible
Style/ConditionalAssignment:
Enabled: false
# most of our APIs are internal so don't require docs
Style/Documentation:
Enabled: false
@ -97,7 +78,7 @@ Style/Documentation:
Style/FrozenStringLiteralComment:
Enabled: false
# so many of these in formulae and can't be autocorrected
# potential for errors in formulae too high with this
Style/GuardClause:
Enabled: false
@ -110,6 +91,14 @@ Style/HashSyntax:
- '**/lib/**/*.rb'
- '**/spec/**/*.rb'
# autocorrectable and more readable
Style/HashEachMethods:
Enabled: true
Style/HashTransformKeys:
Enabled: true
Style/HashTransformValues:
Enabled: true
# ruby style guide favorite
Style/StringLiterals:
EnforcedStyle: double_quotes

View File

@ -22,6 +22,10 @@ Layout/MultilineMethodCallIndentation:
Lint/AmbiguousRegexpLiteral:
Enabled: true
# TODO: add parentheses for these and remove
Lint/AssignmentInCondition:
Enabled: false
# `formula do` uses nested method definitions
Lint/NestedMethodDefinition:
Exclude:

View File

@ -27,10 +27,10 @@ module Homebrew
end
end
update_path
if @version
@version = Version.create(@version)
@version = if @version
Version.create(@version)
else
@version = Version.detect(url, {})
Version.detect(url, {})
end
end