-
Notifications
You must be signed in to change notification settings - Fork 8
/
.rubocop.yml
260 lines (239 loc) · 5.8 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
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
AllCops:
RubyInterpreters:
- ruby
Exclude:
- 'bin/**/*'
- 'script/**/*'
- 'tmp/**/*'
- '.git/**/*'
EnabledByDefault: true
NewCops: enable
TargetRubyVersion: 3.2
#
# Bundler Cops
#
Bundler/GemComment:
# We require comments when versions are restricted or are loaded directly from git
OnlyFor:
- version_specifiers
- git
- github
Bundler/GemVersion:
# We only restrict versions when necessary
Enabled: false
#
# Layout Cops
#
Layout/ArgumentAlignment:
# Align the elements of a hash literal if they span more than one line.
EnforcedStyle: with_first_argument
Layout/DotPosition:
# Multi-line method chaining should be done with leading dots.
EnforcedStyle: leading
Layout/ClassStructure:
Enabled: true
ExpectedOrder:
- module_inclusion
- constants
- public_attribute_macros
- macros
- association
- public_delegate
- initializer
- public_methods
- protected_attribute_macros
- protected_methods
- private_attribute_macros
- private_delegate
- private_methods
- public_class_methods
Layout/ExtraSpacing:
AllowForAlignment: false
AllowBeforeTrailingComments: true
Layout/FirstArgumentIndentation:
EnforcedStyle: consistent
Layout/HashAlignment:
# Alignment of entries using hash rocket as separator.
EnforcedHashRocketStyle: key
# Alignment of entries using colon as separator.
EnforcedColonStyle: key
# Select whether hashes that are the last argument in a method call should be
# inspected?
EnforcedLastArgumentHashStyle: always_inspect
Layout/LineLength:
Max: 100
Layout/MultilineArrayLineBreaks:
Enabled: true
AllowMultilineFinalElement: true
Layout/MultilineMethodArgumentLineBreaks:
Enabled: true
AllowMultilineFinalElement: true
Layout/MultilineAssignmentLayout:
Enabled: false
Layout/MultilineOperationIndentation:
# Multi-line methods on one object should be indented in following lines.
EnforcedStyle: indented
Layout/RedundantLineBreak:
Enabled: false
Layout/SingleLineBlockChain:
Enabled: false
#
# Lint Cops
#
Lint/ConstantResolution:
Enabled: false
Lint/NumberConversion:
Enabled: false
#
# Metrics Cops
#
Metrics/BlockLength:
Enabled: false
Metrics/ClassLength:
Enabled: false
Metrics/MethodLength:
Enabled: false
Metrics/ModuleLength:
Enabled: false
#
# Naming Cops
#
Naming/BlockForwarding:
EnforcedStyle: explicit
Naming/MethodParameterName:
MinNameLength: 2
Naming/PredicateName:
# Allow methods like `is_active?`
Enabled: false
Naming/VariableNumber:
# methods and variables should be `version_5` instead of `version5`
EnforcedStyle: snake_case
CheckSymbols: false
AllowedIdentifiers: [
capture3, # default
iso8601, # default
rfc1123_date, # default
rfc822, # default
rfc2822, # default
rfc3339, # default
x86_6, # default
s3,
country_iso_2,
country_iso_3
]
#
# Rspec Cops
#
RSpec/AlignLeftLetBrace:
Enabled: false
RSpec/AlignRightLetBrace:
Enabled: false
RSpec/ContextWording:
Prefixes:
- when
- with
- without
- and
- but
- for
RSpec/ExampleLength:
Max: 15
RSpec/ImplicitExpect:
EnforcedStyle: should
RSpec/MultipleExpectations:
Enabled: false
RSpec/NoExpectationExample:
Enabled: false
RSpec/MultipleMemoizedHelpers:
Enabled: true
Max: 15
RSpec/NestedGroups:
Max: 5
RSpec/NotToNot:
EnforcedStyle: to_not
RSpec/SpecFilePathFormat:
CustomTransform:
RuboCop: rubocop
RSpec: rspec
#
# Style Cops
#
Style/Alias:
# Prefer `alias_method` over `alias`
EnforcedStyle: prefer_alias_method
Style/ArgumentsForwarding:
UseAnonymousForwarding: false
Style/ArrayFirstLast:
Enabled: false # Too many false positives on match, string or hash; or for consistency
Style/AsciiComments:
Enabled: false
Style/ClassMethodsDefinitions:
# Class methods to be defined using `class << self`
EnforcedStyle: self_class
Style/ClassVars:
Enabled: false # Covered by Reek's ClassVariable smell
Style/CollectionMethods:
# Align with the style guide.
Enabled: false
Style/ConstantVisibility:
Enabled: false
Style/Copyright:
# disable checking for copyright comments in our code
Enabled: false
Style/DisableCopsWithinSourceCodeDirective:
Enabled: false
Style/Documentation:
# do not require top level docs for classes/modules
Enabled: false
Style/DocumentationMethod:
Exclude:
# restore default exlusions, as editing the default overwrites it
- 'spec/**/*'
- 'test/**/*'
Style/FetchEnvVar:
# requires Rails/EnvironmentVariableAccess also to be disabled
Enabled: false # We accept that ENV['foo'] can return `nil`
Style/FrozenStringLiteralComment:
# Frozen stuff, disabled for now
Enabled: false
Style/HashSyntax:
EnforcedShorthandSyntax: never
Style/InlineComment:
Enabled: false
Style/Lambda:
# disable lambda cop to allow multiline ->{} for scopes...
Enabled: false
Style/MethodCallWithArgsParentheses:
Enabled: false
Style/MissingElse:
Enabled: false
Style/ModuleFunction:
EnforcedStyle: forbidden
Style/MultilineBlockChain:
Enabled: false
Style/MutableConstant:
Enabled: false
Style/QuotedSymbols:
EnforcedStyle: same_as_string_literals
Style/RaiseArgs:
EnforcedStyle: exploded
Style/RedundantException:
Enabled: false
Style/RegexpLiteral:
# We always want to use %r{} around regexes, as it tends to make them more
# readable and avoids warnings when changing regexes (e.g. removing slashes)
EnforcedStyle: percent_r
Style/SignalException:
EnforcedStyle: only_raise
Style/StringHashKeys:
Enabled: false
Style/StringLiterals:
EnforcedStyle: single_quotes
Style/StringLiteralsInInterpolation:
EnforcedStyle: single_quotes
Style/TrailingCommaInArguments:
EnforcedStyleForMultiline: no_comma
Style/TrailingCommaInArrayLiteral:
EnforcedStyleForMultiline: comma
Style/TrailingCommaInHashLiteral:
EnforcedStyleForMultiline: comma