-
Notifications
You must be signed in to change notification settings - Fork 2
/
.rubocop.yml
192 lines (151 loc) · 3.45 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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
# For all options see https://github.com/bbatsov/rubocop/tree/master/config
require:
- rubocop-rails
- rubocop-rspec
AllCops:
DisplayCopNames: true
Exclude:
- .*/**/*
- vendor/**/*
- Gemfile
- db/schema.rb
NewCops: enable
Layout/HashAlignment:
EnforcedHashRocketStyle: table
EnforcedColonStyle: key
EnforcedLastArgumentHashStyle: ignore_implicit
# Limit lines to 120 characters.
Layout/LineLength:
Max: 120
Layout/MultilineMethodCallIndentation:
EnforcedStyle: indented
# Use leading rather than trailing dots on multi-line call chains
Layout/DotPosition:
EnforcedStyle: leading
Metrics/AbcSize:
Max: 30
Exclude:
- 'app/views/**/*.rb'
Metrics/BlockLength:
AllowedMethods:
# RSpec
- context
- describe
- path
# routes
- draw
# phlex
- div
- form
# ActiveAdmin
- build_menu
- namespace
# Initializers
- setup
Exclude:
# ActiveAdmin
- app/admin/**/*.rb
- app/views/**/*.rb
Metrics/ClassLength:
Enabled: false
Metrics/CyclomaticComplexity:
Max: 10
Metrics/ModuleLength:
Enabled: false
# Avoid methods longer than 87 lines of code
Metrics/MethodLength:
CountComments: false # count full line comments?
Max: 87
Metrics/ParameterLists:
Exclude:
- 'app/views/components/*.rb'
Metrics/PerceivedComplexity:
Max: 10
Style/ArgumentsForwarding:
Exclude:
- 'app/views/components/*.rb' # unnamed block argument forwarding causes an InfiniteCorrectionLoop error in RuboCop for some components
UseAnonymousForwarding: false
Style/HashSyntax:
EnforcedShorthandSyntax: never
Style/OpenStructUse:
Enabled: false
# Expect a trailing comma
Style/TrailingCommaInArguments:
EnforcedStyleForMultiline: comma
Style/TrailingCommaInArrayLiteral:
EnforcedStyleForMultiline: comma
Style/TrailingCommaInHashLiteral:
EnforcedStyleForMultiline: comma
# Avoid single-line methods.
Style/SingleLineMethods:
AllowIfMethodIsEmpty: true
Style/StringLiterals:
Enabled: false
Style/QuotedSymbols:
Enabled: false
Style/FrozenStringLiteralComment:
Enabled: true
Style/GlobalVars:
Enabled: false # We use them Redis + StatsD (though maybe we shouldn't?)
# Wants underscores in all large numbers. Pain in the ass for things like
# unix timestamps.
Style/NumericLiterals:
Enabled: false
# Wants you to use the same argument names for every reduce. This seems kinda
# naff compared to naming them semantically
Style/SingleLineBlockParams:
Enabled: false
Style/SignalException:
EnforcedStyle: 'only_raise'
# Allow non-ASCII characters (e.g. £) in comments
Style/AsciiComments:
Enabled: false
Style/Documentation:
Enabled: false
# Allow method names beginning with capital letters to match Salesforce conventions
Naming/MethodName:
Enabled: false
Naming/FileName:
Exclude:
- Gemfile
- Guardfile
Lint/UriEscapeUnescape:
Enabled: false
Lint/TopLevelReturnWithArgument:
Exclude:
- '**/*.arb'
Lint/MissingSuper:
Exclude:
- 'app/views/**/*.rb'
# Rails Cops
Rails/HasManyOrHasOneDependent:
Enabled: false
# RSpec Cops
RSpec/AlignLeftLetBrace:
Enabled: true
RSpec/ExampleLength:
Max: 10
CountAsOne:
- array
- heredoc
- hash
- method_call
RSpec/ContextWording:
Prefixes:
- and
- as
- for
- if
- unless
- when
- with
- without
RSpec/MultipleExpectations:
Max: 4
RSpec/MultipleMemoizedHelpers:
Max: 25
AllowSubject: true
RSpec/MessageSpies:
Enabled: false
RSpec/NestedGroups:
Max: 5