brew/Library/.rubocop.yml

132 lines
3.2 KiB
YAML
Raw Normal View History

2018-11-12 04:46:47 +01:00
inherit_from: ./.rubocop_shared.yml
# enable all formulae audits
FormulaAudit:
Enabled: true
# enable all formulae strict audits
FormulaAuditStrict:
Enabled: true
# disable all formulae strict audits by default
NewFormulaAudit:
Enabled: false
2017-06-30 11:43:47 +05:30
2018-11-02 17:17:35 +00:00
# make our hashes consistent
2019-11-28 15:10:50 +00:00
Layout/HashAlignment:
2018-11-02 17:17:35 +00:00
EnforcedHashRocketStyle: table
EnforcedColonStyle: table
# `system` is a special case and aligns on second argument
2019-11-28 15:10:50 +00:00
Layout/ArgumentAlignment:
2016-09-18 14:27:09 +01:00
Enabled: false
2016-09-25 02:41:14 +02:00
# favour parens-less DSL-style arguments
Lint/AmbiguousOperator:
Enabled: false
# this is a bit less "floaty"
Layout/CaseIndentation:
EnforcedStyle: end
2016-09-18 14:27:09 +01:00
# this is a bit less "floaty"
2018-03-05 11:46:38 +00:00
Layout/EndAlignment:
EnforcedStyleAlignWith: start_of_line
2016-09-25 02:41:14 +02:00
# conflicts with DSL-style path concatenation with `/`
Layout/SpaceAroundOperators:
2016-09-18 14:27:09 +01:00
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/RescueEnsureAlignment:
Enabled: false
# favour parens-less DSL-style arguments
Lint/AmbiguousBlockAssociation:
2016-09-18 14:27:09 +01:00
Enabled: false
2016-09-25 02:41:14 +02:00
# so many of these in formulae and can't be autocorrected
# TODO: fix these as `ruby -w` complains about them.
2016-09-18 14:27:09 +01:00
Lint/AmbiguousRegexpLiteral:
Enabled: false
2016-09-25 02:41:14 +02:00
# assignment in conditions are useful sometimes
# TODO: add parentheses for these and remove
2016-09-18 14:27:09 +01:00
Lint/AssignmentInCondition:
Enabled: false
2016-09-25 02:41:14 +02:00
# we output how to use interpolated strings too often
Lint/InterpolationCheck:
Enabled: false
# so many of these in formulae and can't be autocorrected
2016-09-18 14:27:09 +01:00
Lint/ParenthesesAsGroupedExpression:
Enabled: false
# most metrics don't make sense to apply for formulae/taps
Metrics/AbcSize:
Enabled: false
Metrics/ClassLength:
Enabled: false
Metrics/CyclomaticComplexity:
Enabled: false
Metrics/MethodLength:
Enabled: false
Metrics/ModuleLength:
Enabled: false
Metrics/PerceivedComplexity:
Enabled: false
# GitHub diff UI wraps beyond 118 characters (so that's the goal)
2019-12-19 12:01:51 +00:00
Layout/LineLength:
Max: 167
# ignore manpage comments and long single-line strings
IgnoredPatterns: ['#: ', ' url "', ' mirror "', ' plist_options :']
2016-09-25 02:41:14 +02:00
# our current conditional style is established
# TODO: enable this when possible
2016-09-25 02:41:14 +02:00
Style/ConditionalAssignment:
Enabled: false
# most of our APIs are internal so don't require docs
2016-09-25 02:41:14 +02:00
Style/Documentation:
Enabled: false
# don't want this for formulae but re-enabled for Library/Homebrew
Style/FrozenStringLiteralComment:
Enabled: false
# so many of these in formulae and can't be autocorrected
Style/GuardClause:
Enabled: false
# depends_on a: :b looks weird in formulae.
Style/HashSyntax:
EnforcedStyle: hash_rockets
Exclude:
- '**/Guardfile'
- '**/cmd/**/*.rb'
- '**/lib/**/*.rb'
- '**/spec/**/*.rb'
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
# make things a bit easier to read
Style/TernaryParentheses:
EnforcedStyle: require_parentheses_when_complex
# messes with existing plist/caveats style
Style/TrailingBodyOnMethodDefinition:
Enabled: false
# a bit confusing to non-Rubyists but useful for longer arrays
2016-09-25 02:41:14 +02:00
Style/WordArray:
MinSize: 4