aboutsummaryrefslogtreecommitdiffstats
path: root/Library/.rubocop.yml
diff options
context:
space:
mode:
authorMike McQuaid2017-05-28 16:59:53 +0100
committerMike McQuaid2017-05-29 18:42:02 +0100
commit4356016b4a1c2eaba02680b4ad7f1747d2df53bf (patch)
tree9932f9c8fd87d9bdb4d36770012748782e5a497c /Library/.rubocop.yml
parent3165fd2519c41a2be7e12442a5098d3b699fda04 (diff)
downloadbrew-4356016b4a1c2eaba02680b4ad7f1747d2df53bf.tar.bz2
Use parallel RuboCop
This requires updating to Rubocop 0.49.0 which will require some fixes to rules, in Homebrew/brew and Homebrew/homebrew-core but opening this for now so I remember.
Diffstat (limited to 'Library/.rubocop.yml')
-rw-r--r--Library/.rubocop.yml117
1 files changed, 69 insertions, 48 deletions
diff --git a/Library/.rubocop.yml b/Library/.rubocop.yml
index 12886a508..66e71027e 100644
--- a/Library/.rubocop.yml
+++ b/Library/.rubocop.yml
@@ -23,70 +23,94 @@ FormulaAuditStrict/ComponentsRedundancy:
FormulaAudit/Homepage:
Enabled: true
-Metrics/AbcSize:
- Enabled: false
-
-Metrics/BlockLength:
- Enabled: false
-
-Metrics/ClassLength:
+# `system` is a special case and aligns on second argument
+Layout/AlignParameters:
Enabled: false
-Metrics/CyclomaticComplexity:
- Enabled: false
+Layout/CaseIndentation:
+ EnforcedStyle: end
-Metrics/LineLength:
- Enabled: false
+Layout/EmptyLineBetweenDefs:
+ AllowAdjacentOneLineDefs: true
-Metrics/MethodLength:
- Enabled: false
+Layout/IndentArray:
+ EnforcedStyle: special_inside_parentheses
-Metrics/ModuleLength:
- CountComments: false
- Exclude:
- - '**/bin/**/*'
- - '**/cmd/**/*'
- - '**/lib/**/*'
- - '**/spec/**/*'
+Layout/IndentHeredoc:
+ EnforcedStyle: unindent
-Metrics/PerceivedComplexity:
+# conflicts with DSL-style path concatenation with `/`
+Layout/SpaceAroundOperators:
Enabled: false
# favor parens-less DSL-style arguments
Lint/AmbiguousOperator:
Enabled: false
+# so many of these in formulae and can't be autocorrected
Lint/AmbiguousRegexpLiteral:
Enabled: false
+# favor parens-less DSL-style arguments
+Lint/AmbiguousBlockAssociation:
+ Enabled: false
+
+# assignment in conditions are useful sometimes
Lint/AssignmentInCondition:
Enabled: false
Lint/EndAlignment:
EnforcedStyleAlignWith: variable
+# so many of these in formulae and can't be autocorrected
Lint/ParenthesesAsGroupedExpression:
Enabled: false
-Style/Alias:
- EnforcedStyle: prefer_alias
+# TODO: try to bring down all metrics maximums
+Metrics/AbcSize:
+ Max: 250
-Style/AlignHash:
- Enabled: false
+Metrics/BlockLength:
+ Max: 1250
-# `system` is a special case and aligns on second argument
-Style/AlignParameters:
+Metrics/ClassLength:
+ Max: 1500
+
+Metrics/CyclomaticComplexity:
+ Max: 75
+
+Metrics/LineLength:
+ Max: 400
+
+Metrics/MethodLength:
+ Max: 250
+
+Metrics/ModuleLength:
+ CountComments: false
+ Exclude:
+ - '**/bin/**/*'
+ - '**/cmd/**/*'
+ - '**/lib/**/*'
+
+Metrics/PerceivedComplexity:
+ Max: 80
+
+# makes code less readable for minor performance increases
+Performance/Caller:
Enabled: false
+Style/Alias:
+ EnforcedStyle: prefer_alias
+
+Style/AutoResourceCleanup:
+ Enabled: true
+
Style/BarePercentLiterals:
EnforcedStyle: percent_q
Style/BlockDelimiters:
EnforcedStyle: line_count_based
-Style/CaseIndentation:
- EnforcedStyle: end
-
Style/ClassAndModuleChildren:
EnforcedStyle: nested
@@ -99,16 +123,22 @@ Style/CommandLiteral:
Style/ConditionalAssignment:
Enabled: false
+# most of our APIs are internal so don't require docs
Style/Documentation:
Enabled: false
-Style/EmptyLineBetweenDefs:
- AllowAdjacentOneLineDefs: true
+Style/Encoding:
+ Enabled: true
# dashes in filenames are typical
Style/FileName:
Regex: !ruby/regexp /^[\w\@\-\+\.]+(\.rb)?$/
+# falsely flags e.g. curl formatting arguments as format strings
+Style/FormatStringToken:
+ Enabled: false
+
+# so many of these in formulae and can't be autocorrected
Style/GuardClause:
Enabled: false
@@ -121,13 +151,6 @@ Style/HashSyntax:
- '**/lib/**/*'
- '**/spec/**/*'
-# disabled until it respects line length
-Style/IfUnlessModifier:
- Enabled: false
-
-Style/IndentArray:
- EnforcedStyle: special_inside_parentheses
-
# only for numbers >= 1_000_000
Style/NumericLiterals:
MinDigits: 7
@@ -160,13 +183,6 @@ Style/RaiseArgs:
Style/RegexpLiteral:
EnforcedStyle: slashes
-# conflicts with DSL-style path concatenation with `/`
-Style/SpaceAroundOperators:
- Enabled: false
-
-Style/SingleLineBlockParams:
- Enabled: false
-
# not a problem for typical shell users
Style/SpecialGlobalVars:
Enabled: false
@@ -179,17 +195,22 @@ Style/StringLiterals:
Style/StringLiteralsInInterpolation:
EnforcedStyle: double_quotes
+Style/SymbolArray:
+ EnforcedStyle: brackets
+
Style/TernaryParentheses:
- Enabled: false
+ EnforcedStyle: require_parentheses_when_complex
# makes diffs nicer
Style/TrailingCommaInLiteral:
EnforcedStyleForMultiline: comma
+
Style/TrailingCommaInArguments:
EnforcedStyleForMultiline: comma
+# we have too many variables like sha256 where this harms readability
Style/VariableNumber:
Enabled: false
Style/WordArray:
- Enabled: false
+ MinSize: 4