2016-09-27 18:48:06 +02:00
|
|
|
AllCops:
|
|
|
|
|
TargetRubyVersion: 2.0
|
2016-10-11 01:00:23 +02:00
|
|
|
Exclude:
|
2016-11-26 21:29:02 +00:00
|
|
|
- '**/Rakefile'
|
|
|
|
|
- '**/.*'
|
2016-10-11 01:00:23 +02:00
|
|
|
- '**/Casks/**/*'
|
2016-11-26 21:29:02 +00:00
|
|
|
- '**/vendor/**/*'
|
2016-09-27 18:48:06 +02:00
|
|
|
|
2017-02-12 11:07:03 +05:30
|
|
|
require: ./Homebrew/rubocops.rb
|
2017-01-18 15:54:47 +05:30
|
|
|
|
2017-05-03 11:33:00 +05:30
|
|
|
FormulaAuditStrict/BottleBlock:
|
2017-03-02 20:26:29 +05:30
|
|
|
Enabled: true
|
|
|
|
|
|
2017-05-03 11:33:00 +05:30
|
|
|
FormulaAuditStrict/Desc:
|
2017-01-18 15:54:47 +05:30
|
|
|
Enabled: true
|
|
|
|
|
|
2017-05-03 11:33:00 +05:30
|
|
|
FormulaAuditStrict/ComponentsOrder:
|
2017-04-08 15:10:44 +05:30
|
|
|
Enabled: true
|
|
|
|
|
|
2017-05-03 11:33:00 +05:30
|
|
|
FormulaAuditStrict/ComponentsRedundancy:
|
2017-04-08 15:10:44 +05:30
|
|
|
Enabled: true
|
|
|
|
|
|
2017-05-14 13:49:42 +05:30
|
|
|
FormulaAudit/Homepage:
|
|
|
|
|
Enabled: true
|
|
|
|
|
|
2017-05-28 16:59:53 +01:00
|
|
|
# `system` is a special case and aligns on second argument
|
|
|
|
|
Layout/AlignParameters:
|
2016-09-18 14:27:09 +01:00
|
|
|
Enabled: false
|
2016-09-25 02:41:14 +02:00
|
|
|
|
2017-05-28 16:59:53 +01:00
|
|
|
Layout/CaseIndentation:
|
|
|
|
|
EnforcedStyle: end
|
2016-09-18 14:27:09 +01:00
|
|
|
|
2017-05-28 16:59:53 +01:00
|
|
|
Layout/EmptyLineBetweenDefs:
|
|
|
|
|
AllowAdjacentOneLineDefs: true
|
2016-09-18 14:27:09 +01:00
|
|
|
|
2017-05-28 16:59:53 +01:00
|
|
|
Layout/IndentArray:
|
|
|
|
|
EnforcedStyle: special_inside_parentheses
|
2016-09-25 02:41:14 +02:00
|
|
|
|
2017-05-28 16:59:53 +01:00
|
|
|
Layout/IndentHeredoc:
|
|
|
|
|
EnforcedStyle: unindent
|
2016-09-25 02:41:14 +02:00
|
|
|
|
2017-05-28 16:59:53 +01:00
|
|
|
# conflicts with DSL-style path concatenation with `/`
|
|
|
|
|
Layout/SpaceAroundOperators:
|
2016-09-18 14:27:09 +01:00
|
|
|
Enabled: false
|
|
|
|
|
|
|
|
|
|
# favor parens-less DSL-style arguments
|
|
|
|
|
Lint/AmbiguousOperator:
|
|
|
|
|
Enabled: false
|
2016-09-25 02:41:14 +02:00
|
|
|
|
2017-05-28 16:59:53 +01:00
|
|
|
# so many of these in formulae and can't be autocorrected
|
2016-09-18 14:27:09 +01:00
|
|
|
Lint/AmbiguousRegexpLiteral:
|
|
|
|
|
Enabled: false
|
2016-09-25 02:41:14 +02:00
|
|
|
|
2017-05-28 16:59:53 +01:00
|
|
|
# favor parens-less DSL-style arguments
|
|
|
|
|
Lint/AmbiguousBlockAssociation:
|
|
|
|
|
Enabled: false
|
|
|
|
|
|
|
|
|
|
# assignment in conditions are useful sometimes
|
2016-09-18 14:27:09 +01:00
|
|
|
Lint/AssignmentInCondition:
|
|
|
|
|
Enabled: false
|
2016-09-25 02:41:14 +02:00
|
|
|
|
|
|
|
|
Lint/EndAlignment:
|
2017-02-12 11:07:03 +05:30
|
|
|
EnforcedStyleAlignWith: variable
|
2016-09-25 02:41:14 +02:00
|
|
|
|
2017-05-28 16:59:53 +01:00
|
|
|
# so many of these in formulae and can't be autocorrected
|
2016-09-18 14:27:09 +01:00
|
|
|
Lint/ParenthesesAsGroupedExpression:
|
|
|
|
|
Enabled: false
|
|
|
|
|
|
2017-05-28 16:59:53 +01:00
|
|
|
# TODO: try to bring down all metrics maximums
|
|
|
|
|
Metrics/AbcSize:
|
|
|
|
|
Max: 250
|
2016-09-25 02:41:14 +02:00
|
|
|
|
2017-05-28 16:59:53 +01:00
|
|
|
Metrics/BlockLength:
|
|
|
|
|
Max: 1250
|
2016-09-25 02:41:14 +02:00
|
|
|
|
2017-05-28 16:59:53 +01:00
|
|
|
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:
|
2016-09-25 02:41:14 +02:00
|
|
|
Enabled: false
|
|
|
|
|
|
2017-05-28 16:59:53 +01:00
|
|
|
Style/Alias:
|
|
|
|
|
EnforcedStyle: prefer_alias
|
|
|
|
|
|
|
|
|
|
Style/AutoResourceCleanup:
|
|
|
|
|
Enabled: true
|
|
|
|
|
|
2016-10-22 13:32:46 +01:00
|
|
|
Style/BarePercentLiterals:
|
|
|
|
|
EnforcedStyle: percent_q
|
|
|
|
|
|
|
|
|
|
Style/BlockDelimiters:
|
|
|
|
|
EnforcedStyle: line_count_based
|
|
|
|
|
|
2016-09-25 02:41:14 +02:00
|
|
|
Style/ClassAndModuleChildren:
|
|
|
|
|
EnforcedStyle: nested
|
|
|
|
|
|
|
|
|
|
# percent-x is allowed for multiline
|
|
|
|
|
Style/CommandLiteral:
|
|
|
|
|
EnforcedStyle: mixed
|
|
|
|
|
|
|
|
|
|
# our current conditional style is established, clear and
|
|
|
|
|
# requiring users to change that now would be confusing.
|
|
|
|
|
Style/ConditionalAssignment:
|
|
|
|
|
Enabled: false
|
|
|
|
|
|
2017-05-28 16:59:53 +01:00
|
|
|
# most of our APIs are internal so don't require docs
|
2016-09-25 02:41:14 +02:00
|
|
|
Style/Documentation:
|
|
|
|
|
Enabled: false
|
|
|
|
|
|
2017-05-28 16:59:53 +01:00
|
|
|
Style/Encoding:
|
|
|
|
|
Enabled: true
|
2016-09-18 14:27:09 +01:00
|
|
|
|
2016-09-25 02:41:14 +02:00
|
|
|
# dashes in filenames are typical
|
|
|
|
|
Style/FileName:
|
|
|
|
|
Regex: !ruby/regexp /^[\w\@\-\+\.]+(\.rb)?$/
|
|
|
|
|
|
2017-05-28 16:59:53 +01:00
|
|
|
# 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
|
2016-10-01 12:13:09 +01:00
|
|
|
Style/GuardClause:
|
|
|
|
|
Enabled: false
|
|
|
|
|
|
2016-10-22 13:32:46 +01:00
|
|
|
# depends_on a: :b looks weird in formulae.
|
2016-10-01 12:13:09 +01:00
|
|
|
Style/HashSyntax:
|
|
|
|
|
EnforcedStyle: hash_rockets
|
2016-10-22 15:53:18 +01:00
|
|
|
Exclude:
|
2016-11-02 21:49:05 -04:00
|
|
|
- '**/bin/**/*'
|
2016-10-22 15:53:18 +01:00
|
|
|
- '**/cmd/**/*'
|
2016-11-02 21:49:05 -04:00
|
|
|
- '**/lib/**/*'
|
|
|
|
|
- '**/spec/**/*'
|
2016-10-01 12:13:09 +01:00
|
|
|
|
2016-09-25 02:41:14 +02:00
|
|
|
# only for numbers >= 1_000_000
|
|
|
|
|
Style/NumericLiterals:
|
|
|
|
|
MinDigits: 7
|
|
|
|
|
|
|
|
|
|
# zero-prefixed octal literals are just too widely used (and mostly understood)
|
|
|
|
|
Style/NumericLiteralPrefix:
|
|
|
|
|
EnforcedOctalStyle: zero_only
|
|
|
|
|
|
2016-09-18 14:27:09 +01:00
|
|
|
# consistency and readability when faced with string interpolation
|
|
|
|
|
Style/PercentLiteralDelimiters:
|
|
|
|
|
PreferredDelimiters:
|
|
|
|
|
'%': '()'
|
|
|
|
|
'%i': '()'
|
|
|
|
|
'%q': '()'
|
|
|
|
|
'%Q': '()'
|
|
|
|
|
'%r': '{}'
|
|
|
|
|
'%s': '()'
|
|
|
|
|
'%w': '[]'
|
|
|
|
|
'%W': '[]'
|
|
|
|
|
'%x': '()'
|
|
|
|
|
|
2016-09-25 02:41:14 +02:00
|
|
|
# we prefer Perl-style regex back references
|
|
|
|
|
Style/PerlBackrefs:
|
|
|
|
|
Enabled: false
|
|
|
|
|
|
|
|
|
|
Style/RaiseArgs:
|
|
|
|
|
EnforcedStyle: exploded
|
|
|
|
|
|
|
|
|
|
# paths abound, easy escape
|
|
|
|
|
Style/RegexpLiteral:
|
|
|
|
|
EnforcedStyle: slashes
|
|
|
|
|
|
2016-09-18 14:27:09 +01:00
|
|
|
# not a problem for typical shell users
|
|
|
|
|
Style/SpecialGlobalVars:
|
|
|
|
|
Enabled: false
|
|
|
|
|
|
2016-09-25 02:41:14 +02:00
|
|
|
# ruby style guide favorite
|
|
|
|
|
Style/StringLiterals:
|
|
|
|
|
EnforcedStyle: double_quotes
|
2016-09-18 14:27:09 +01:00
|
|
|
|
2016-09-25 02:41:14 +02:00
|
|
|
# consistency with above
|
|
|
|
|
Style/StringLiteralsInInterpolation:
|
|
|
|
|
EnforcedStyle: double_quotes
|
2016-09-20 21:13:04 +02:00
|
|
|
|
2017-05-28 16:59:53 +01:00
|
|
|
Style/SymbolArray:
|
|
|
|
|
EnforcedStyle: brackets
|
|
|
|
|
|
2016-09-21 15:14:15 +02:00
|
|
|
Style/TernaryParentheses:
|
2017-05-28 16:59:53 +01:00
|
|
|
EnforcedStyle: require_parentheses_when_complex
|
2016-09-21 15:14:15 +02:00
|
|
|
|
2016-09-18 14:27:09 +01:00
|
|
|
# makes diffs nicer
|
|
|
|
|
Style/TrailingCommaInLiteral:
|
|
|
|
|
EnforcedStyleForMultiline: comma
|
2017-05-28 16:59:53 +01:00
|
|
|
|
2017-02-12 15:06:54 +00:00
|
|
|
Style/TrailingCommaInArguments:
|
|
|
|
|
EnforcedStyleForMultiline: comma
|
2016-09-18 14:27:09 +01:00
|
|
|
|
2017-05-28 16:59:53 +01:00
|
|
|
# we have too many variables like sha256 where this harms readability
|
2016-09-25 02:41:14 +02:00
|
|
|
Style/VariableNumber:
|
|
|
|
|
Enabled: false
|
2016-09-18 14:27:09 +01:00
|
|
|
|
2016-09-25 02:41:14 +02:00
|
|
|
Style/WordArray:
|
2017-05-28 16:59:53 +01:00
|
|
|
MinSize: 4
|