aboutsummaryrefslogtreecommitdiffstats
path: root/Library/.rubocop_rules.yml
diff options
context:
space:
mode:
Diffstat (limited to 'Library/.rubocop_rules.yml')
-rw-r--r--Library/.rubocop_rules.yml45
1 files changed, 30 insertions, 15 deletions
diff --git a/Library/.rubocop_rules.yml b/Library/.rubocop_rules.yml
index cde310930..543dc4018 100644
--- a/Library/.rubocop_rules.yml
+++ b/Library/.rubocop_rules.yml
@@ -1,4 +1,3 @@
-
# ruby style guide favorite
Style/StringLiterals:
EnforcedStyle: double_quotes
@@ -7,17 +6,30 @@ Style/StringLiterals:
Style/StringLiteralsInInterpolation:
EnforcedStyle: double_quotes
+# 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
+
# percent-x is allowed for multiline
Style/CommandLiteral:
EnforcedStyle: mixed
+# depends_on foo: :bar looks rubbish
+Style/HashSyntax:
+ EnforcedStyle: ruby19
+ Exclude:
+ - 'Taps/**/*'
+
# paths abound, easy escape
Style/RegexpLiteral:
EnforcedStyle: slashes
-# too prevalent to change this now, but might be discussed/changed later
Style/Alias:
- EnforcedStyle: prefer_alias_method
+ EnforcedStyle: prefer_alias
# our current conditional style is established, clear and
# requiring users to change that now would be confusing.
@@ -58,14 +70,6 @@ Lint/ParenthesesAsGroupedExpression:
Style/EmptyLineBetweenDefs:
AllowAdjacentOneLineDefs: true
-# port numbers and such tech stuff
-Style/NumericLiterals:
- Enabled: false
-
-# zero-prefixed octal literals are just too widely used (and mostly understood)
-Style/NumericLiteralPrefix:
- EnforcedOctalStyle: zero_only
-
# consistency and readability when faced with string interpolation
Style/PercentLiteralDelimiters:
PreferredDelimiters:
@@ -93,15 +97,25 @@ Style/AlignParameters:
# counterproductive in formulas, notably within the install method
Style/GuardClause:
- Enabled: false
+ Exclude:
+ - 'Taps/**/*'
Style/IfUnlessModifier:
+ Exclude:
+ - 'Taps/**/*'
+
+# TODO: enforce when rubocop has fixed this
+# https://github.com/bbatsov/rubocop/issues/3516
+Style/VariableNumber:
+ Enabled: false
+
+# TODO: enforce when rubocop has shipped this
+# https://github.com/bbatsov/rubocop/pull/3513
+Style/TernaryParentheses:
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
+ Regex: !ruby/regexp /^[\w\@\-\+\.]+(\.rb)?$/
# no percent word array, being friendly to non-ruby users
# TODO: enforce when rubocop has fixed this
@@ -134,6 +148,7 @@ Style/MethodName:
Style/PredicateName:
Exclude:
- 'Homebrew/compat/**/*'
+ NameWhitelist: is_32_bit?, is_64_bit?
# `formula do` uses nested method definitions
Lint/NestedMethodDefinition: