2019-01-21 13:39:11 +00:00
|
|
|
inherit_from: ../.rubocop_rspec.yml
|
2016-09-27 18:48:06 +02:00
|
|
|
|
|
|
|
|
AllCops:
|
|
|
|
|
Include:
|
2018-06-06 23:05:00 -04:00
|
|
|
- '**/*.rb'
|
2018-06-11 15:56:56 -04:00
|
|
|
- 'Library/Homebrew/.simplecov'
|
2016-09-27 18:48:06 +02:00
|
|
|
Exclude:
|
2018-01-07 15:40:42 +00:00
|
|
|
- 'bin/*'
|
2016-10-11 01:00:23 +02:00
|
|
|
- '**/Casks/**/*'
|
2016-09-28 22:34:09 +02:00
|
|
|
- '**/vendor/**/*'
|
2016-09-27 18:48:06 +02:00
|
|
|
|
2019-04-30 09:19:29 +01:00
|
|
|
# messes up system formatting for formulae but good for Homebrew/brew
|
|
|
|
|
Layout/AlignArguments:
|
|
|
|
|
Enabled: true
|
|
|
|
|
|
2018-09-02 20:14:54 +01:00
|
|
|
# make rspec formatting more flexible
|
2017-05-28 16:59:53 +01:00
|
|
|
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
|
|
|
|
2016-10-22 13:32:46 +01:00
|
|
|
# so many of these in formulae but none in here
|
|
|
|
|
Lint/AmbiguousRegexpLiteral:
|
|
|
|
|
Enabled: true
|
|
|
|
|
|
2016-09-27 18:48:06 +02:00
|
|
|
# `formula do` uses nested method definitions
|
|
|
|
|
Lint/NestedMethodDefinition:
|
|
|
|
|
Exclude:
|
2016-09-28 22:34:09 +02:00
|
|
|
- 'test/**/*'
|
2016-09-27 18:48:06 +02:00
|
|
|
|
2016-10-22 13:32:46 +01:00
|
|
|
# so many of these in formulae but none in here
|
|
|
|
|
Lint/ParenthesesAsGroupedExpression:
|
2016-10-22 15:53:18 +01:00
|
|
|
Enabled: true
|
2016-10-22 13:32:46 +01:00
|
|
|
|
2018-09-02 20:14:54 +01:00
|
|
|
# unused keyword arguments improve APIs
|
2018-07-08 20:08:51 +02:00
|
|
|
Lint/UnusedMethodArgument:
|
|
|
|
|
AllowUnusedKeywordArguments: true
|
|
|
|
|
|
2017-10-27 09:34:38 +01:00
|
|
|
# TODO: try to bring down all metrics maximums
|
|
|
|
|
Metrics/AbcSize:
|
2018-09-02 20:14:54 +01:00
|
|
|
Enabled: true
|
|
|
|
|
Max: 275
|
2017-10-09 18:27:02 +02:00
|
|
|
Metrics/BlockLength:
|
2018-09-02 20:14:54 +01:00
|
|
|
Enabled: true
|
|
|
|
|
Max: 1100
|
2017-10-07 00:31:28 +02:00
|
|
|
Metrics/BlockNesting:
|
2018-09-02 20:14:54 +01:00
|
|
|
Enabled: true
|
2017-10-07 00:31:28 +02:00
|
|
|
Max: 5
|
2017-10-09 18:27:02 +02:00
|
|
|
Metrics/ClassLength:
|
2018-09-02 20:14:54 +01:00
|
|
|
Enabled: true
|
|
|
|
|
Max: 1400
|
2017-10-27 09:34:38 +01:00
|
|
|
Metrics/CyclomaticComplexity:
|
2018-09-02 20:14:54 +01:00
|
|
|
Enabled: true
|
2017-10-27 09:34:38 +01:00
|
|
|
Max: 75
|
2017-10-09 18:27:02 +02:00
|
|
|
Metrics/MethodLength:
|
2018-09-02 20:14:54 +01:00
|
|
|
Enabled: true
|
|
|
|
|
Max: 300
|
2017-10-27 09:34:38 +01:00
|
|
|
Metrics/ModuleLength:
|
2018-09-02 20:14:54 +01:00
|
|
|
Enabled: true
|
2019-07-02 14:50:02 +02:00
|
|
|
Max: 550
|
2017-10-27 09:34:38 +01:00
|
|
|
Metrics/PerceivedComplexity:
|
2018-09-02 20:14:54 +01:00
|
|
|
Enabled: true
|
2017-10-27 09:34:38 +01:00
|
|
|
Max: 100
|
|
|
|
|
|
2018-09-02 20:14:54 +01:00
|
|
|
# GitHub diff UI wraps beyond 118 characters
|
|
|
|
|
Metrics/LineLength:
|
|
|
|
|
Max: 118
|
|
|
|
|
# ignore manpage comments
|
|
|
|
|
IgnoredPatterns: ['#: ']
|
2017-10-07 00:31:28 +02:00
|
|
|
|
|
|
|
|
# we won't change backward compatible predicate names
|
|
|
|
|
Naming/PredicateName:
|
|
|
|
|
Exclude:
|
|
|
|
|
- 'compat/**/*'
|
2019-01-23 21:57:37 +00:00
|
|
|
# can't rename these
|
2017-10-07 00:31:28 +02:00
|
|
|
NameWhitelist: is_32_bit?, is_64_bit?
|
|
|
|
|
|
2018-09-02 20:14:54 +01:00
|
|
|
# whitelist those that are standard
|
|
|
|
|
# TODO: try to remove some of these
|
2018-03-05 11:46:38 +00:00
|
|
|
Naming/UncommunicativeMethodParamName:
|
2018-09-02 20:14:54 +01:00
|
|
|
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
|
|
|
|
|
|
2018-09-02 20:14:54 +01:00
|
|
|
# make rspec formatting more flexible
|
2017-05-28 16:59:53 +01:00
|
|
|
Style/BlockDelimiters:
|
|
|
|
|
Exclude:
|
|
|
|
|
- '**/*_spec.rb'
|
2017-10-03 10:49:58 +02:00
|
|
|
- '**/shared_examples/**/*.rb'
|
2017-05-28 16:59:53 +01:00
|
|
|
|
2018-09-02 20:14:54 +01:00
|
|
|
# document our public APIs
|
|
|
|
|
Style/Documentation:
|
|
|
|
|
Enabled: true
|
|
|
|
|
Include:
|
|
|
|
|
- 'Library/Homebrew/formula.rb'
|
|
|
|
|
Style/DocumentationMethod:
|
|
|
|
|
Enabled: true
|
|
|
|
|
Include:
|
|
|
|
|
- 'Library/Homebrew/formula.rb'
|
|
|
|
|
|
2019-04-19 15:21:16 +09:00
|
|
|
# don't want this for formulae but re-enabled for Library/Homebrew
|
|
|
|
|
Style/FrozenStringLiteralComment:
|
|
|
|
|
Enabled: true
|
|
|
|
|
EnforcedStyle: always
|
|
|
|
|
|
2016-10-22 13:32:46 +01:00
|
|
|
# so many of these in formulae but none in here
|
|
|
|
|
Style/GuardClause:
|
|
|
|
|
Enabled: true
|
2016-09-27 18:48:06 +02:00
|
|
|
|
2018-09-02 20:14:54 +01:00
|
|
|
# hash-rockets preferred for formulae, a: 1 preferred here
|
2016-09-27 18:48:06 +02:00
|
|
|
Style/HashSyntax:
|
|
|
|
|
EnforcedStyle: ruby19_no_mixed_keys
|
2018-01-07 15:40:42 +00:00
|
|
|
|
2019-04-19 18:08:05 +09:00
|
|
|
# would rather freeze too much than too little
|
|
|
|
|
Style/MutableConstant:
|
|
|
|
|
EnforcedStyle: strict
|
|
|
|
|
|
2019-02-19 13:11:32 +00:00
|
|
|
# LineLength is low enough here to re-enable it.
|
|
|
|
|
Style/IfUnlessModifier:
|
|
|
|
|
Enabled: true
|
|
|
|
|
|
2018-01-07 15:40:42 +00:00
|
|
|
# so many of these in formulae but none in here
|
|
|
|
|
Style/TrailingBodyOnMethodDefinition:
|
|
|
|
|
Enabled: true
|