brew/Library/.rubocop.yml
Xu Cheng 3b68215be7 rubocop: remove conflicted rules
Since trailing commas in method argument lists are a syntax error in
1.8, let's enforce the default rule of `TrailingComma`(i.e. `no_comma`)

Closes Homebrew/homebrew#42398.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-08-03 18:47:24 +08:00

135 lines
2.9 KiB
YAML

AllCops:
Exclude:
- 'Homebrew/vendor/**/*'
- 'Homebrew/test/vendor/**/*'
# 1.8-style hash keys
Style/HashSyntax:
EnforcedStyle: hash_rockets
# ruby style guide favorite
Style/StringLiterals:
EnforcedStyle: double_quotes
# consistency with above
Style/StringLiteralsInInterpolation:
EnforcedStyle: double_quotes
# percent-x is allowed for multiline
Style/CommandLiteral:
EnforcedStyle: mixed
# paths abound, easy escape
Style/RegexpLiteral:
EnforcedStyle: slashes
# no metrics for formulas
Metrics/AbcSize:
Enabled: false
Metrics/CyclomaticComplexity:
Enabled: false
Metrics/MethodLength:
Enabled: false
Metrics/ClassLength:
Enabled: false
Metrics/PerceivedComplexity:
Enabled: false
# we often need very long lines
Metrics/LineLength:
Enabled: false
# formulas have no mandatory doc
Style/Documentation:
Enabled: false
# favor parens-less DSL-style arguments
Lint/AmbiguousOperator:
Enabled: false
Lint/AmbiguousRegexpLiteral:
Enabled: false
Lint/AssignmentInCondition:
Enabled: false
Lint/ParenthesesAsGroupedExpression:
Enabled: false
# compact style
Style/EmptyLineBetweenDefs:
AllowAdjacentOneLineDefs: true
# port numbers and such tech stuff
Style/NumericLiterals:
Enabled: false
# consistency and readability when faced with string interpolation
Style/PercentLiteralDelimiters:
PreferredDelimiters:
'%': '()'
'%i': '()'
'%q': '()'
'%Q': '()'
'%r': '{}'
'%s': '()'
'%w': '[]'
'%W': '[]'
'%x': '()'
# conflicts with DSL-style path concatenation with `/`
Style/SpaceAroundOperators:
Enabled: false
# not a problem for typical shell users
Style/SpecialGlobalVars:
Enabled: false
# `system` is a special case and aligns on second argument
Style/AlignParameters:
Enabled: false
# counterproductive in formulas, notably within the install method
Style/GuardClause:
Enabled: false
Style/IfUnlessModifier:
Enabled: false
# dashes in filenames are typical
# TODO: enforce when rubocop has fixed this
# https://github.com/bbatsov/rubocop/issues/1545
Style/FileName:
Enabled: false
# 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:
Enabled: false
Style/UnneededCapitalW:
Enabled: false
# TODO: rubocop bug regarding __END__
# see https://github.com/bbatsov/rubocop/issues/1541
Style/TrailingWhitespace:
Enabled: false
Style/Tab:
Enabled: false
Style/TrailingBlankLines:
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
Style/CaseIndentation:
IndentWhenRelativeTo: end
# we prefer Perl-style regex back references
Style/PerlBackrefs:
Enabled: false
# this is required for Ruby 1.8
Style/DotPosition:
EnforcedStyle: trailing