2015-08-02 14:56:01 +01:00
|
|
|
AllCops:
|
2016-09-17 15:32:44 +01:00
|
|
|
TargetRubyVersion: 2.0
|
2015-08-02 14:56:01 +01:00
|
|
|
Exclude:
|
|
|
|
|
- 'Homebrew/vendor/**/*'
|
|
|
|
|
- 'Homebrew/test/vendor/**/*'
|
|
|
|
|
|
2014-12-31 18:01:58 +01:00
|
|
|
# ruby style guide favorite
|
|
|
|
|
Style/StringLiterals:
|
2016-05-31 22:10:59 +02:00
|
|
|
EnforcedStyle: double_quotes
|
2014-12-31 18:01:58 +01:00
|
|
|
|
|
|
|
|
# consistency with above
|
|
|
|
|
Style/StringLiteralsInInterpolation:
|
2016-05-31 22:10:59 +02:00
|
|
|
EnforcedStyle: double_quotes
|
2014-12-31 18:01:58 +01:00
|
|
|
|
2015-04-14 23:08:33 +01:00
|
|
|
# percent-x is allowed for multiline
|
|
|
|
|
Style/CommandLiteral:
|
2016-05-31 22:10:59 +02:00
|
|
|
EnforcedStyle: mixed
|
2015-04-14 23:08:33 +01:00
|
|
|
|
|
|
|
|
# paths abound, easy escape
|
|
|
|
|
Style/RegexpLiteral:
|
2016-05-31 22:10:59 +02:00
|
|
|
EnforcedStyle: slashes
|
2015-04-14 23:08:33 +01:00
|
|
|
|
2016-07-12 07:49:55 +02:00
|
|
|
# too prevalent to change this now, but might be discussed/changed later
|
|
|
|
|
Style/Alias:
|
|
|
|
|
EnforcedStyle: prefer_alias_method
|
|
|
|
|
|
2016-02-01 15:33:59 +00:00
|
|
|
# our current conditional style is established, clear and
|
|
|
|
|
# requiring users to change that now would be confusing.
|
|
|
|
|
Style/ConditionalAssignment:
|
2016-05-31 22:10:59 +02:00
|
|
|
Enabled: false
|
2016-02-01 15:33:59 +00:00
|
|
|
|
2014-12-31 18:01:58 +01:00
|
|
|
# no metrics for formulas
|
|
|
|
|
Metrics/AbcSize:
|
2016-05-31 22:10:59 +02:00
|
|
|
Enabled: false
|
2014-12-31 18:01:58 +01:00
|
|
|
Metrics/CyclomaticComplexity:
|
2016-05-31 22:10:59 +02:00
|
|
|
Enabled: false
|
2014-12-31 18:01:58 +01:00
|
|
|
Metrics/MethodLength:
|
2016-05-31 22:10:59 +02:00
|
|
|
Enabled: false
|
2014-12-31 18:01:58 +01:00
|
|
|
Metrics/ClassLength:
|
2016-05-31 22:10:59 +02:00
|
|
|
Enabled: false
|
2014-12-31 18:01:58 +01:00
|
|
|
Metrics/PerceivedComplexity:
|
2016-05-31 22:10:59 +02:00
|
|
|
Enabled: false
|
2014-12-31 18:01:58 +01:00
|
|
|
|
2015-01-05 19:01:39 +00:00
|
|
|
# we often need very long lines
|
2014-12-31 18:01:58 +01:00
|
|
|
Metrics/LineLength:
|
2016-05-31 22:10:59 +02:00
|
|
|
Enabled: false
|
2014-12-31 18:01:58 +01:00
|
|
|
|
|
|
|
|
# formulas have no mandatory doc
|
|
|
|
|
Style/Documentation:
|
2016-05-31 22:10:59 +02:00
|
|
|
Enabled: false
|
2014-12-31 18:01:58 +01:00
|
|
|
|
|
|
|
|
# favor parens-less DSL-style arguments
|
|
|
|
|
Lint/AmbiguousOperator:
|
2016-05-31 22:10:59 +02:00
|
|
|
Enabled: false
|
2014-12-31 18:01:58 +01:00
|
|
|
Lint/AmbiguousRegexpLiteral:
|
2016-05-31 22:10:59 +02:00
|
|
|
Enabled: false
|
2014-12-31 18:01:58 +01:00
|
|
|
Lint/AssignmentInCondition:
|
2016-05-31 22:10:59 +02:00
|
|
|
Enabled: false
|
2014-12-31 18:01:58 +01:00
|
|
|
Lint/ParenthesesAsGroupedExpression:
|
2016-05-31 22:10:59 +02:00
|
|
|
Enabled: false
|
2014-12-31 18:01:58 +01:00
|
|
|
|
|
|
|
|
# compact style
|
|
|
|
|
Style/EmptyLineBetweenDefs:
|
2016-05-31 22:10:59 +02:00
|
|
|
AllowAdjacentOneLineDefs: true
|
2014-12-31 18:01:58 +01:00
|
|
|
|
|
|
|
|
# port numbers and such tech stuff
|
|
|
|
|
Style/NumericLiterals:
|
2016-05-31 22:10:59 +02:00
|
|
|
Enabled: false
|
2014-12-31 18:01:58 +01:00
|
|
|
|
2016-07-04 07:19:44 +02:00
|
|
|
# zero-prefixed octal literals are just too widely used (and mostly understood)
|
|
|
|
|
Style/NumericLiteralPrefix:
|
|
|
|
|
EnforcedOctalStyle: zero_only
|
|
|
|
|
|
2014-12-31 18:01:58 +01:00
|
|
|
# consistency and readability when faced with string interpolation
|
|
|
|
|
Style/PercentLiteralDelimiters:
|
2016-05-31 22:10:59 +02:00
|
|
|
PreferredDelimiters:
|
|
|
|
|
'%': '()'
|
|
|
|
|
'%i': '()'
|
|
|
|
|
'%q': '()'
|
|
|
|
|
'%Q': '()'
|
|
|
|
|
'%r': '{}'
|
|
|
|
|
'%s': '()'
|
|
|
|
|
'%w': '[]'
|
|
|
|
|
'%W': '[]'
|
|
|
|
|
'%x': '()'
|
2014-12-31 18:01:58 +01:00
|
|
|
|
|
|
|
|
# conflicts with DSL-style path concatenation with `/`
|
|
|
|
|
Style/SpaceAroundOperators:
|
2016-05-31 22:10:59 +02:00
|
|
|
Enabled: false
|
2014-12-31 18:01:58 +01:00
|
|
|
|
|
|
|
|
# not a problem for typical shell users
|
|
|
|
|
Style/SpecialGlobalVars:
|
2016-05-31 22:10:59 +02:00
|
|
|
Enabled: false
|
2014-12-31 18:01:58 +01:00
|
|
|
|
|
|
|
|
# `system` is a special case and aligns on second argument
|
|
|
|
|
Style/AlignParameters:
|
2016-05-31 22:10:59 +02:00
|
|
|
Enabled: false
|
2014-12-31 18:01:58 +01:00
|
|
|
|
|
|
|
|
# counterproductive in formulas, notably within the install method
|
|
|
|
|
Style/GuardClause:
|
2016-05-31 22:10:59 +02:00
|
|
|
Enabled: false
|
2014-12-31 18:01:58 +01:00
|
|
|
Style/IfUnlessModifier:
|
2016-05-31 22:10:59 +02:00
|
|
|
Enabled: false
|
2014-12-31 18:01:58 +01:00
|
|
|
|
|
|
|
|
# dashes in filenames are typical
|
|
|
|
|
# TODO: enforce when rubocop has fixed this
|
|
|
|
|
# https://github.com/bbatsov/rubocop/issues/1545
|
|
|
|
|
Style/FileName:
|
2016-05-31 22:10:59 +02:00
|
|
|
Enabled: false
|
2014-12-31 18:01:58 +01:00
|
|
|
|
|
|
|
|
# no percent word array, being friendly to non-ruby users
|
|
|
|
|
# TODO: enforce when rubocop has fixed this
|
|
|
|
|
# https://github.com/bbatsov/rubocop/issues/1543
|
|
|
|
|
Style/WordArray:
|
2016-05-31 22:10:59 +02:00
|
|
|
Enabled: false
|
2015-01-24 21:07:31 -05:00
|
|
|
Style/UnneededCapitalW:
|
2016-05-31 22:10:59 +02:00
|
|
|
Enabled: false
|
2014-12-31 18:01:58 +01:00
|
|
|
|
2015-08-02 15:38:41 +01:00
|
|
|
# we prefer compact if-else-end/case-when-end alignment
|
2015-08-02 19:57:43 +08:00
|
|
|
Lint/EndAlignment:
|
|
|
|
|
AlignWith: variable
|
|
|
|
|
Style/CaseIndentation:
|
|
|
|
|
IndentWhenRelativeTo: end
|
|
|
|
|
|
2015-08-02 15:38:41 +01:00
|
|
|
# we prefer Perl-style regex back references
|
2015-08-02 19:57:43 +08:00
|
|
|
Style/PerlBackrefs:
|
|
|
|
|
Enabled: false
|
2015-08-02 15:38:41 +01:00
|
|
|
|
2015-09-09 09:42:21 +01:00
|
|
|
# makes diffs nicer
|
2016-01-15 23:25:47 -08:00
|
|
|
Style/TrailingCommaInLiteral:
|
2015-11-10 19:14:49 +00:00
|
|
|
EnforcedStyleForMultiline: comma
|