-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy path.rubocop.yml
126 lines (91 loc) · 2.31 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# Please, comment the reason a certain property is enabled, disabled, or overridden
AllCops:
TargetRubyVersion: 2.5
#
# Enables
#
Style/CollectionMethods:
Enabled: true
Style/Encoding:
Enabled: true
Style/MethodCalledOnDoEndBlock:
Enabled: true
Style/Send:
Enabled: true
#
# Overrides
#
# Limit the use of Ruby idioms overly uncommon in other languages
Style/WordArray:
EnforcedStyle: brackets
Style/SymbolArray:
EnforcedStyle: brackets
# Ease modifying arrays and parameter lists
Style/TrailingCommaInHashLiteral:
EnforcedStyleForMultiline: comma
Style/TrailingCommaInArrayLiteral:
EnforcedStyleForMultiline: comma
Style/TrailingCommaInArguments:
EnforcedStyleForMultiline: comma
# Allow logical `or`/`and` in conditionals
Style/AndOr:
EnforcedStyle: conditionals
# Adapt better to our architecture and tooling
Metrics/LineLength:
Max: 120
# Allow longer classes
Metrics/ClassLength:
Max: 300
# Allow longer functional modules
Metrics/ModuleLength:
Max: 300
# Allow multiple value returns (like `return x, y`)
Style/RedundantReturn:
AllowMultipleReturnValues: true
# We prefer the literal syntax ->(){}
Style/Lambda:
EnforcedStyle: literal
# The way we are using blocks in tests will not conform to this rule
Metrics/BlockLength:
Exclude:
- 'lib/**/*_spec.rb'
- 'lib/**/spec_*.rb'
- 'test/**/*'
Max: 30
Naming/UncommunicativeMethodParamName:
MinNameLength: 2
#
# Disables
#
# Allow us to distinguish pure blocks from side-effect ones
Style/BlockDelimiters:
Enabled: false
# UTF-8 is perfectly fine in comments
Style/AsciiComments:
Enabled: false
# Checked by CI tools
Style/Documentation:
Enabled: false
# Currently it does not detect when the enclosed lines are too big
Style/GuardClause:
Enabled: false
# Allow reduce and inject (FP) over each_with_object (ruby-only)
Style/EachWithObject:
Enabled: false
# Multiline block chains are ok
Style/MultilineBlockChain:
Enabled: false
# Does not play well with chained conditional assignments
Metrics/AbcSize:
Enabled: false
# We can take care of this on our own
Metrics/ParameterLists:
Enabled: false
# We can take care of this on our own
Metrics/MethodLength:
Enabled: false
# Simple methods can trigger these metrics
Metrics/CyclomaticComplexity:
Enabled: false
Metrics/PerceivedComplexity:
Enabled: false