-
Notifications
You must be signed in to change notification settings - Fork 0
/
.rubocop.yml
59 lines (50 loc) · 1.49 KB
/
.rubocop.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# add indent after access modifier e.g. private
Layout/IndentationConsistency:
EnforcedStyle: indented_internal_methods
# Use double quotes by default, common in large projects including rails
# https://anti-pattern.com/always-use-double-quoted-strings-in-ruby
Style/StringLiterals:
Enabled: true
EnforcedStyle: double_quotes
Style/ColonMethodCall:
Enabled: false
# use %r for long expressions e.g shared_constants acronym_regex
Style/RegexpLiteral:
Enabled: false
# prefer parens for method calls with args
# exceptions for Gmefile, spec, require, etc. type methods
Style/MethodCallWithArgsParentheses:
Enabled: true
IgnoredMethods:
- expect
- gem
- include
- load
- require
- require_relative
- raise
- ruby
- source
- to
- to_not
# don't like .zero? instead of == 0
Style/NumericPredicate:
Enabled: false
# preferred method aliases
Style/CollectionMethods:
Enabled: true
PreferredMethods:
collect: map
collect!: map!
inject: reduce
detect: find
find_all: select
# TODO: prefer length / size to count when no args ar present for performance (count O(n), length o(1))
# https://stackoverflow.com/questions/53480273/are-there-performance-reasons-to-prefer-size-over-length-or-count-in-ruby
# deviations from https://gist.github.com/ConorSheehan1/ed75920ca8722a09b527b37f006cf8e3
# no docs for brew classes
Style/Documentation:
Enabled: false
Style/FrozenStringLiteralComment:
Exclude:
- "Formula/*.rb"