brew/Library/.rubocop.yml

227 lines
4.5 KiB
YAML
Raw Normal View History

AllCops:
2017-09-24 19:10:57 +01:00
TargetRubyVersion: 2.3
2016-10-11 01:00:23 +02:00
Exclude:
- '**/Casks/**/*'
- '**/vendor/**/*'
2017-02-12 11:07:03 +05:30
require: ./Homebrew/rubocops.rb
FormulaAudit:
Enabled: true
FormulaAuditStrict:
Enabled: true
NewFormulaAudit:
Enabled: false
2017-06-30 11:43:47 +05:30
# `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
Layout/CaseIndentation:
EnforcedStyle: end
2016-09-18 14:27:09 +01:00
Layout/EmptyLineBetweenDefs:
AllowAdjacentOneLineDefs: true
2016-09-18 14:27:09 +01:00
Layout/IndentArray:
EnforcedStyle: special_inside_parentheses
2016-09-25 02:41:14 +02:00
Layout/IndentHeredoc:
2017-10-15 02:28:32 +02:00
EnforcedStyle: squiggly
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
# favor parens-less DSL-style arguments
Lint/AmbiguousOperator:
Enabled: false
2016-09-25 02:41:14 +02: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
# 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
# so many of these in formulae and can't be autocorrected
2016-09-18 14:27:09 +01:00
Lint/ParenthesesAsGroupedExpression:
Enabled: false
# TODO: try to bring down all metrics maximums
Metrics/AbcSize:
Enabled: false
2016-09-25 02:41:14 +02:00
Metrics/BlockLength:
Enabled: false
2016-09-25 02:41:14 +02:00
Metrics/ClassLength:
Enabled: false
Metrics/CyclomaticComplexity:
Enabled: false
Metrics/LineLength:
Max: 324
# ignore manpage comments
IgnoredPatterns: ['#: ']
Metrics/MethodLength:
Enabled: false
Metrics/ModuleLength:
Enabled: false
Metrics/ParameterLists:
CountKeywordArgs: false
Metrics/PerceivedComplexity:
Enabled: false
# makes code less readable for minor performance increases
Performance/Caller:
2016-09-25 02:41:14 +02:00
Enabled: false
Style/Alias:
EnforcedStyle: prefer_alias
Style/AsciiComments:
Enabled: false
Style/AutoResourceCleanup:
Enabled: true
Style/BarePercentLiterals:
EnforcedStyle: percent_q
Style/BlockDelimiters:
EnforcedStyle: line_count_based
2016-09-25 02:41:14 +02:00
Style/ClassAndModuleChildren:
EnforcedStyle: nested
# our current conditional style is established, clear and
# requiring users to change that now would be confusing.
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
Style/Encoding:
Enabled: true
2016-09-18 14:27:09 +01:00
# use spaces for indentation; detect tabs
Layout/Tab:
Enabled: true
2017-10-21 19:05:50 +02:00
# We have no use for using `warn` because we are
# calling Ruby with warnings disabled ourselves.
Style/StderrPuts:
Enabled: false
2016-09-25 02:41:14 +02:00
# dashes in filenames are typical
2017-09-24 19:10:57 +01:00
Naming/FileName:
2016-09-25 02:41:14 +02:00
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
# depends_on a: :b looks weird in formulae.
Style/HashSyntax:
EnforcedStyle: hash_rockets
Exclude:
- '**/bin/**/*'
- '**/cmd/**/*'
- '**/lib/**/*'
- '**/spec/**/*'
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
Style/RaiseArgs:
EnforcedStyle: exploded
# paths abound, easy escape
Style/RegexpLiteral:
EnforcedStyle: slashes
# 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
Style/SymbolArray:
EnforcedStyle: brackets
Style/TernaryParentheses:
EnforcedStyle: require_parentheses_when_complex
2016-09-18 14:27:09 +01:00
# makes diffs nicer
Style/TrailingCommaInLiteral:
EnforcedStyleForMultiline: comma
Style/TrailingCommaInArguments:
EnforcedStyleForMultiline: comma
2016-09-18 14:27:09 +01:00
# we have too many variables like sha256 where this harms readability
2017-09-24 19:10:57 +01:00
Naming/VariableNumber:
2016-09-25 02:41:14 +02:00
Enabled: false
2016-09-18 14:27:09 +01:00
2016-09-25 02:41:14 +02:00
Style/WordArray:
MinSize: 4
2017-09-24 19:10:57 +01:00
# we want to add this slowly and manually
Style/FrozenStringLiteralComment:
Enabled: false
# generally rescuing StandardError is fine
Lint/RescueWithoutErrorClass:
Enabled: false
# implicitly allow EOS as we use it everywhere
Naming/HeredocDelimiterNaming:
Blacklist:
- END, EOD, EOF
# we output how to use interpolated strings too often
Lint/InterpolationCheck:
Enabled: false