brew/Library/Homebrew/.rubocop.yml

139 lines
2.6 KiB
YAML
Raw Normal View History

inherit_from: ../.rubocop_rspec.yml
AllCops:
Include:
2018-06-06 23:05:00 -04:00
- '**/*.rb'
- 'Library/Homebrew/.simplecov'
Exclude:
2018-01-07 15:40:42 +00:00
- 'bin/*'
- '**/vendor/**/*'
# messes up system formatting for formulae but good for Homebrew/brew
2019-11-28 15:10:50 +00:00
Layout/ArgumentAlignment:
Enabled: true
# make rspec formatting more flexible
Layout/MultilineMethodCallIndentation:
2016-10-23 14:44:14 +02:00
Exclude:
2017-02-12 17:26:34 +01:00
- '**/*_spec.rb'
2016-10-23 14:44:14 +02:00
# so many of these in formulae but none in here
Lint/AmbiguousRegexpLiteral:
Enabled: true
2020-03-13 21:14:24 +00:00
# TODO: add parentheses for these and remove
Lint/AssignmentInCondition:
Enabled: false
# `formula do` uses nested method definitions
Lint/NestedMethodDefinition:
Exclude:
- 'test/**/*'
# so many of these in formulae but none in here
Lint/ParenthesesAsGroupedExpression:
Enabled: true
# TODO: try to bring down all metrics maximums
Metrics/AbcSize:
Enabled: true
Max: 275
Metrics/BlockLength:
Enabled: true
Max: 1100
2020-03-16 01:37:49 +05:30
Exclude:
- 'test/formula_spec.rb'
Metrics/BlockNesting:
Enabled: true
Max: 5
Metrics/ClassLength:
Enabled: true
Max: 1400
Metrics/CyclomaticComplexity:
Enabled: true
2020-06-22 14:09:33 +01:00
Max: 85
Metrics/MethodLength:
Enabled: true
Max: 300
Metrics/ModuleLength:
Enabled: true
2019-07-02 14:50:02 +02:00
Max: 550
Metrics/PerceivedComplexity:
Enabled: true
Max: 100
# we won't change backward compatible predicate names
Naming/PredicateName:
Exclude:
- 'compat/**/*'
# can't rename these
2019-11-28 15:10:50 +00:00
AllowedMethods: is_32_bit?, is_64_bit?
# allow those that are standard
# TODO: try to remove some of these
2019-11-28 15:10:50 +00:00
Naming/MethodParameterName:
AllowedNames:
- '_'
- 'a'
- 'b'
- 'cc'
- 'c1'
- 'c2'
- 'd'
- 'e'
- 'f'
- 'ff'
- 'fn'
- 'id'
- 'io'
- 'o'
- 'p'
- 'pr'
- 'r'
- 'rb'
- 's'
- 'to'
- 'v'
2018-03-05 11:46:38 +00:00
2018-06-06 23:34:19 -04:00
# Avoid false positives on modifiers used on symbols of methods
# See https://github.com/rubocop-hq/rubocop/issues/5953
2018-06-06 23:05:00 -04:00
Style/AccessModifierDeclarations:
Enabled: false
# make rspec formatting more flexible
Style/BlockDelimiters:
Exclude:
- '**/*_spec.rb'
2017-10-03 10:49:58 +02:00
- '**/shared_examples/**/*.rb'
2020-07-07 11:29:33 +01:00
# don't group nicely documented or private attr_readers
Style/AccessorGrouping:
Exclude:
- 'formula.rb'
- 'formulary.rb'
- 'migrator.rb'
- 'resource.rb'
- 'system_command.rb'
- 'tap.rb'
# document our public APIs
Style/Documentation:
Enabled: true
Include:
2020-07-07 11:29:33 +01:00
- 'formula.rb'
Style/DocumentationMethod:
Enabled: true
Include:
2020-07-07 11:29:33 +01:00
- 'formula.rb'
# don't want this for formulae but re-enabled for Library/Homebrew
Style/FrozenStringLiteralComment:
Enabled: true
EnforcedStyle: always
Exclude:
- '**/Casks/**/*.rb'
# so many of these in formulae but none in here
Style/GuardClause:
Enabled: true