tolken 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +11 -0
- data/.rspec +3 -0
- data/.rubocop.yml +718 -0
- data/.travis.yml +19 -0
- data/Gemfile +8 -0
- data/Gemfile.lock +181 -0
- data/LICENSE.txt +21 -0
- data/README.md +147 -0
- data/Rakefile +6 -0
- data/bin/console +15 -0
- data/bin/setup +9 -0
- data/lib/tolken.rb +11 -0
- data/lib/tolken/hash_serializer.rb +16 -0
- data/lib/tolken/simle_form.rb +35 -0
- data/lib/tolken/translates.rb +42 -0
- data/lib/tolken/version.rb +5 -0
- data/tolken.gemspec +40 -0
- metadata +223 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 4fba9918f15512180b1e6b5165de2db39b55f5e40d1f990aa940c3a5ebf3f4f3
|
4
|
+
data.tar.gz: 438b87384e727fa84bfae004b6bfe2cf5835fd8ec13e05ef1ffac752271a896c
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 4da7a01fd5f07fabc16ad2d59eb3a29dddd316cfd5b0e19ba6b3d1471ffd218074eca29e49f0fb1ee609640700b0e72b93e9b21cfdc2c39c19bde19fd49bcb24
|
7
|
+
data.tar.gz: 583bb33c59af8dd984d86d3c3dd3adc790843003a746d65a3c93c0d25c699d365ece9cd9d7a988e7257d4fd0309613ffe8336a234436408c9220cc982787c9ea
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,718 @@
|
|
1
|
+
# See https://github.com/bbatsov/rubocop/blob/master/config/default.yml
|
2
|
+
|
3
|
+
require: rubocop-rspec
|
4
|
+
|
5
|
+
AllCops:
|
6
|
+
TargetRubyVersion: 2.5
|
7
|
+
Exclude:
|
8
|
+
- Rakefile
|
9
|
+
- .rubocop.yml
|
10
|
+
|
11
|
+
Rails:
|
12
|
+
Enabled: true
|
13
|
+
|
14
|
+
Documentation:
|
15
|
+
Enabled: false
|
16
|
+
|
17
|
+
# -- Security
|
18
|
+
|
19
|
+
Security/Eval:
|
20
|
+
Enabled: true
|
21
|
+
|
22
|
+
# -- Performance
|
23
|
+
|
24
|
+
Performance/StringReplacement:
|
25
|
+
Reference: "https://github.com/JuanitoFatas/fast-ruby#stringgsub-vs-stringtr-code'"
|
26
|
+
Enabled: true
|
27
|
+
|
28
|
+
Performance/ReverseEach:
|
29
|
+
Description: "Use `reverse_each` instead of `reverse.each`."
|
30
|
+
Reference: "https://github.com/JuanitoFatas/fast-ruby#enumerablereverseeach-vs-enumerablereverse_each-code"
|
31
|
+
Enabled: true
|
32
|
+
|
33
|
+
Performance/Sample:
|
34
|
+
Description: "Use `sample` instead of `shuffle.first`, `shuffle.last`, and `shuffle[Fixnum]`."
|
35
|
+
Reference: "https://github.com/JuanitoFatas/fast-ruby#arrayshufflefirst-vs-arraysample-code"
|
36
|
+
Enabled: true
|
37
|
+
|
38
|
+
Performance/Size:
|
39
|
+
Description: "Use `size` instead of `count` for counting the number of elements in `Array` and `Hash`."
|
40
|
+
Reference: "https://github.com/JuanitoFatas/fast-ruby#arraycount-vs-arraysize-code"
|
41
|
+
Enabled: true
|
42
|
+
|
43
|
+
Performance/FlatMap:
|
44
|
+
Description: "Use `Enumerable#flat_map` instead of `Enumerable#map…Array#flatten` or `Enumberable#collect…Array#flatten`."
|
45
|
+
Reference: "https://github.com/JuanitoFatas/fast-ruby#enumerablemaparrayflatten-vs-enumerableflat_map-code"
|
46
|
+
Enabled: true
|
47
|
+
EnabledForFlattenWithoutParams: false
|
48
|
+
|
49
|
+
Performance/Detect:
|
50
|
+
Description: "Use `detect` instead of `select.first`, `find_all.first`, `select.last`, and `find_all.last`."
|
51
|
+
Reference: "https://github.com/JuanitoFatas/fast-ruby#enumerabledetect-vs-enumerableselectfirst-code"
|
52
|
+
Enabled: true
|
53
|
+
|
54
|
+
Performance/Count:
|
55
|
+
Description: "Use `count` instead of `select|reject...size|count|length`"
|
56
|
+
Enabled: true
|
57
|
+
|
58
|
+
# -- Lint
|
59
|
+
|
60
|
+
Lint/Debugger:
|
61
|
+
Enabled: true
|
62
|
+
|
63
|
+
Lint/EndAlignment:
|
64
|
+
EnforcedStyleAlignWith: variable
|
65
|
+
|
66
|
+
Lint/AssignmentInCondition:
|
67
|
+
Description: "bad: `if foo = bar` ok: `if (foo = bar)`"
|
68
|
+
StyleGuide: "https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition"
|
69
|
+
AllowSafeAssignment: true
|
70
|
+
|
71
|
+
Lint/UnusedBlockArgument:
|
72
|
+
StyleGuide: "https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars"
|
73
|
+
AllowUnusedKeywordArguments: false
|
74
|
+
|
75
|
+
Lint/UnusedMethodArgument:
|
76
|
+
StyleGuide: "https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars"
|
77
|
+
AllowUnusedKeywordArguments: false
|
78
|
+
|
79
|
+
Lint/BlockAlignment:
|
80
|
+
Enabled: true
|
81
|
+
|
82
|
+
Lint/CircularArgumentReference:
|
83
|
+
Description: "Don't refer to the keyword argument in the default value."
|
84
|
+
Enabled: true
|
85
|
+
|
86
|
+
Lint/ConditionPosition:
|
87
|
+
StyleGuide: "https://github.com/bbatsov/ruby-style-guide#same-line-condition"
|
88
|
+
Enabled: true
|
89
|
+
|
90
|
+
Lint/DefEndAlignment:
|
91
|
+
Enabled: true
|
92
|
+
|
93
|
+
Lint/DeprecatedClassMethods:
|
94
|
+
Enabled: true
|
95
|
+
|
96
|
+
Lint/DuplicateMethods:
|
97
|
+
Enabled: true
|
98
|
+
|
99
|
+
Lint/EachWithObjectArgument:
|
100
|
+
Description: "Check for immutable argument given to each_with_object."
|
101
|
+
Enabled: true
|
102
|
+
|
103
|
+
Lint/ElseLayout:
|
104
|
+
Description: "Check for odd code arrangement in an else block."
|
105
|
+
Enabled: true
|
106
|
+
|
107
|
+
Lint/EmptyEnsure:
|
108
|
+
Enabled: true
|
109
|
+
|
110
|
+
Lint/EmptyInterpolation:
|
111
|
+
Enabled: true
|
112
|
+
|
113
|
+
Lint/EnsureReturn:
|
114
|
+
Description: "Do not use return in an ensure block."
|
115
|
+
StyleGuide: "https://github.com/bbatsov/ruby-style-guide#no-return-ensure"
|
116
|
+
Enabled: true
|
117
|
+
|
118
|
+
Lint/FormatParameterMismatch:
|
119
|
+
Enabled: true
|
120
|
+
|
121
|
+
Lint/HandleExceptions:
|
122
|
+
StyleGuide: "https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions"
|
123
|
+
Enabled: true
|
124
|
+
|
125
|
+
Lint/LiteralInInterpolation:
|
126
|
+
Enabled: true
|
127
|
+
|
128
|
+
Lint/Loop:
|
129
|
+
Description: "Use Kernel#loop with break rather than begin/end/until or begin/end/while for post-loop tests."
|
130
|
+
StyleGuide: "https://github.com/bbatsov/ruby-style-guide#loop-with-break"
|
131
|
+
Enabled: true
|
132
|
+
|
133
|
+
Lint/NestedMethodDefinition:
|
134
|
+
StyleGuide: "https://github.com/bbatsov/ruby-style-guide#no-nested-methods"
|
135
|
+
Enabled: true
|
136
|
+
|
137
|
+
Lint/NonLocalExitFromIterator:
|
138
|
+
Enabled: true
|
139
|
+
|
140
|
+
Lint/ParenthesesAsGroupedExpression:
|
141
|
+
Description: "bad: `f (3 + 2) + 1`. ok: `f(3 + 2) + 1`"
|
142
|
+
StyleGuide: "https://github.com/bbatsov/ruby-style-guide#parens-no-spaces"
|
143
|
+
Enabled: true
|
144
|
+
|
145
|
+
Lint/RequireParentheses:
|
146
|
+
Description: "Use parentheses in the method call to avoid confusion about precedence."
|
147
|
+
Enabled: true
|
148
|
+
|
149
|
+
Lint/RescueException:
|
150
|
+
StyleGuide: "https://github.com/bbatsov/ruby-style-guide#no-blind-rescues"
|
151
|
+
Enabled: true
|
152
|
+
|
153
|
+
Lint/ShadowingOuterLocalVariable:
|
154
|
+
Description: "Do not use the same name as outer local variable for block arguments or block local variables."
|
155
|
+
Enabled: true
|
156
|
+
|
157
|
+
Lint/StringConversionInInterpolation:
|
158
|
+
Description: "Checks for Object#to_s usage in string interpolation."
|
159
|
+
StyleGuide: "https://github.com/bbatsov/ruby-style-guide#no-to-s"
|
160
|
+
Enabled: true
|
161
|
+
|
162
|
+
Lint/UnderscorePrefixedVariableName:
|
163
|
+
Description: "Do not use prefix `_` for a variable that is used."
|
164
|
+
Enabled: true
|
165
|
+
|
166
|
+
Lint/UnneededDisable:
|
167
|
+
Description: "Checks for rubocop:disable comments that can be removed."
|
168
|
+
Enabled: true
|
169
|
+
|
170
|
+
Lint/UnreachableCode:
|
171
|
+
Enabled: true
|
172
|
+
|
173
|
+
Lint/UselessAccessModifier:
|
174
|
+
Enabled: true
|
175
|
+
|
176
|
+
Lint/UselessAssignment:
|
177
|
+
Description: "Checks for useless assignment to a local variable."
|
178
|
+
StyleGuide: "https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars"
|
179
|
+
Enabled: true
|
180
|
+
|
181
|
+
Lint/UselessComparison:
|
182
|
+
Description: "Checks for comparison of something with itself."
|
183
|
+
Enabled: true
|
184
|
+
|
185
|
+
Lint/UselessElseWithoutRescue:
|
186
|
+
Description: "Checks for useless `else` in `begin..end` without `rescue`."
|
187
|
+
Enabled: true
|
188
|
+
|
189
|
+
Lint/UselessSetterCall:
|
190
|
+
Description: "Checks for useless setter call to a local variable."
|
191
|
+
Enabled: true
|
192
|
+
|
193
|
+
Lint/Void:
|
194
|
+
Description: "Possible use of operator/literal/variable in void context."
|
195
|
+
Enabled: true
|
196
|
+
|
197
|
+
Lint/AmbiguousOperator:
|
198
|
+
Enabled: true
|
199
|
+
|
200
|
+
# -- Metrics
|
201
|
+
|
202
|
+
Metrics/ClassLength:
|
203
|
+
Max: 300
|
204
|
+
|
205
|
+
Metrics/ModuleLength:
|
206
|
+
Max: 300
|
207
|
+
|
208
|
+
Metrics/MethodLength:
|
209
|
+
Max: 25
|
210
|
+
Exclude:
|
211
|
+
- db/migrate/**/*.rb # mostly create table blocks
|
212
|
+
|
213
|
+
Metrics/LineLength:
|
214
|
+
Max: 125
|
215
|
+
AllowHeredoc: true
|
216
|
+
AllowURI: true
|
217
|
+
URISchemes:
|
218
|
+
- http
|
219
|
+
- https
|
220
|
+
IgnoredPatterns: ['\A#', '#\s.+\Z', 'https?:\/\/']
|
221
|
+
|
222
|
+
Metrics/BlockLength:
|
223
|
+
Enabled: true
|
224
|
+
Exclude:
|
225
|
+
- config/environments/*.rb
|
226
|
+
- config/initializers/simple_form_bootstrap.rb
|
227
|
+
- config/routes.rb
|
228
|
+
- db/seeds.rb
|
229
|
+
- bin/seed_daily_booking_mailer.rb
|
230
|
+
- spec/**/*
|
231
|
+
|
232
|
+
Metrics/PerceivedComplexity:
|
233
|
+
Enabled: true
|
234
|
+
|
235
|
+
Metrics/BlockNesting:
|
236
|
+
StyleGuide: "https://github.com/bbatsov/ruby-style-guide#three-is-the-number-thou-shalt-count"
|
237
|
+
Enabled: true
|
238
|
+
Max: 4
|
239
|
+
|
240
|
+
Metrics/CyclomaticComplexity:
|
241
|
+
Description: "A complexity metric that is strongly correlated to the number of test cases needed to validate a method."
|
242
|
+
Max: 9
|
243
|
+
|
244
|
+
Metrics/AbcSize:
|
245
|
+
Description: "A calculated magnitude based on number of assignments, branches, and conditions."
|
246
|
+
Reference: "http://c2.com/cgi/wiki?AbcMetric"
|
247
|
+
Max: 20
|
248
|
+
Exclude:
|
249
|
+
- db/migrate/**/*.rb # mostly create table blocks
|
250
|
+
|
251
|
+
Metrics/ParameterLists:
|
252
|
+
Description: "Avoid parameter lists longer than three or four parameters."
|
253
|
+
StyleGuide: "https://github.com/bbatsov/ruby-style-guide#too-many-params"
|
254
|
+
Enabled: true
|
255
|
+
CountKeywordArgs: false
|
256
|
+
|
257
|
+
# -- Naming
|
258
|
+
|
259
|
+
Naming/AsciiIdentifiers:
|
260
|
+
Enabled: true
|
261
|
+
|
262
|
+
Naming/FileName:
|
263
|
+
Description: "Use snake_case for source file names."
|
264
|
+
StyleGuide: "https://github.com/bbatsov/ruby-style-guide#snake-case-files"
|
265
|
+
Enabled: true
|
266
|
+
|
267
|
+
Naming/MethodName:
|
268
|
+
EnforcedStyle: snake_case
|
269
|
+
|
270
|
+
Naming/VariableName:
|
271
|
+
EnforcedStyle: snake_case
|
272
|
+
|
273
|
+
Naming/BinaryOperatorParameterName:
|
274
|
+
Enabled: false # don't require variable to <=> to be named just "other"
|
275
|
+
|
276
|
+
# -- Layout
|
277
|
+
|
278
|
+
Layout/IndentArray:
|
279
|
+
Enabled: false
|
280
|
+
# Or the following isn't allowed
|
281
|
+
# foo([
|
282
|
+
# %w[n V n],
|
283
|
+
# %w[V S V]
|
284
|
+
# ])
|
285
|
+
|
286
|
+
Layout/CaseIndentation:
|
287
|
+
EnforcedStyle: end
|
288
|
+
|
289
|
+
Layout/AccessModifierIndentation:
|
290
|
+
Description: "Check indentation of private/protected visibility modifiers."
|
291
|
+
StyleGuide: "https://github.com/bbatsov/ruby-style-guide#indent-public-private-protected"
|
292
|
+
EnforcedStyle: indent
|
293
|
+
|
294
|
+
Layout/AlignHash:
|
295
|
+
Description: "Align the elements of a hash literal if they span more than one line."
|
296
|
+
EnforcedHashRocketStyle: key
|
297
|
+
EnforcedColonStyle: key
|
298
|
+
EnforcedLastArgumentHashStyle: always_inspect
|
299
|
+
|
300
|
+
Layout/AlignParameters:
|
301
|
+
Description: "Align the parameters of a method call if they span more than one line."
|
302
|
+
StyleGuide: "https://github.com/bbatsov/ruby-style-guide#no-double-indent"
|
303
|
+
EnforcedStyle: with_first_parameter
|
304
|
+
|
305
|
+
Layout/FirstHashElementLineBreak:
|
306
|
+
Enabled: true
|
307
|
+
|
308
|
+
Layout/FirstArrayElementLineBreak:
|
309
|
+
Enabled: true
|
310
|
+
|
311
|
+
Layout/FirstMethodArgumentLineBreak:
|
312
|
+
Enabled: true
|
313
|
+
|
314
|
+
Layout/FirstMethodParameterLineBreak:
|
315
|
+
Enabled: true
|
316
|
+
|
317
|
+
Layout/FirstParameterIndentation:
|
318
|
+
Enabled: true
|
319
|
+
|
320
|
+
Layout/DotPosition:
|
321
|
+
EnforcedStyle: leading
|
322
|
+
|
323
|
+
Layout/EmptyLinesAroundBlockBody:
|
324
|
+
EnforcedStyle: no_empty_lines
|
325
|
+
|
326
|
+
Layout/EmptyLinesAroundClassBody:
|
327
|
+
EnforcedStyle: no_empty_lines
|
328
|
+
|
329
|
+
Layout/EmptyLinesAroundModuleBody:
|
330
|
+
EnforcedStyle: no_empty_lines
|
331
|
+
|
332
|
+
Layout/ExtraSpacing:
|
333
|
+
AllowForAlignment: true
|
334
|
+
|
335
|
+
Layout/IndentationConsistency:
|
336
|
+
EnforcedStyle: normal
|
337
|
+
|
338
|
+
Layout/IndentationWidth:
|
339
|
+
Width: 2
|
340
|
+
|
341
|
+
Layout/SpaceInLambdaLiteral:
|
342
|
+
EnforcedStyle: require_no_space
|
343
|
+
|
344
|
+
Layout/MultilineArrayBraceLayout:
|
345
|
+
EnforcedStyle: new_line
|
346
|
+
|
347
|
+
Layout/MultilineHashBraceLayout:
|
348
|
+
EnforcedStyle: new_line
|
349
|
+
|
350
|
+
Layout/MultilineMethodCallBraceLayout:
|
351
|
+
EnforcedStyle: symmetrical
|
352
|
+
|
353
|
+
Layout/MultilineMethodDefinitionBraceLayout:
|
354
|
+
EnforcedStyle: new_line
|
355
|
+
|
356
|
+
Layout/ClosingParenthesisIndentation:
|
357
|
+
Enabled: true
|
358
|
+
|
359
|
+
Layout/SpaceAroundBlockParameters:
|
360
|
+
EnforcedStyleInsidePipes: no_space
|
361
|
+
|
362
|
+
Layout/SpaceAroundEqualsInParameterDefault:
|
363
|
+
EnforcedStyle: space
|
364
|
+
|
365
|
+
Layout/SpaceBeforeBlockBraces:
|
366
|
+
EnforcedStyle: space
|
367
|
+
|
368
|
+
Layout/SpaceInsideBlockBraces:
|
369
|
+
EnforcedStyle: space
|
370
|
+
|
371
|
+
Layout/SpaceInsideHashLiteralBraces:
|
372
|
+
EnforcedStyle: space
|
373
|
+
EnforcedStyleForEmptyBraces: no_space
|
374
|
+
|
375
|
+
Layout/SpaceInsideStringInterpolation:
|
376
|
+
EnforcedStyle: no_space
|
377
|
+
|
378
|
+
Layout/TrailingBlankLines:
|
379
|
+
EnforcedStyle: final_newline
|
380
|
+
|
381
|
+
Layout/MultilineMethodCallIndentation:
|
382
|
+
EnforcedStyle: indented
|
383
|
+
|
384
|
+
Layout/SpaceBeforeComma:
|
385
|
+
Enabled: true
|
386
|
+
|
387
|
+
Layout/LeadingCommentSpace:
|
388
|
+
Enabled: true
|
389
|
+
Exclude:
|
390
|
+
- spec/teaspoon_env.rb
|
391
|
+
|
392
|
+
# -- Style
|
393
|
+
|
394
|
+
Style/UnneededPercentQ:
|
395
|
+
Description: "Checks for %q/%Q when single quotes or double quotes would do."
|
396
|
+
StyleGuide: "https://github.com/bbatsov/ruby-style-guide#percent-q"
|
397
|
+
Enabled: false
|
398
|
+
|
399
|
+
Style/MultilineBlockChain:
|
400
|
+
Description: "Disallows multiline do…end.method_call"
|
401
|
+
Enabled: false
|
402
|
+
|
403
|
+
Style/DoubleNegation:
|
404
|
+
Description: "Disallows !! to cast falsy values to false"
|
405
|
+
Enabled: false # Allow !!
|
406
|
+
|
407
|
+
Style/AsciiComments:
|
408
|
+
Enabled: false
|
409
|
+
# Or we can't add comments about Swedish characters for example
|
410
|
+
|
411
|
+
Style/InverseMethods:
|
412
|
+
Description: "bad: `!foo.blank?` ok: `foo.present?`"
|
413
|
+
Enabled: true # Allow !!
|
414
|
+
|
415
|
+
Style/Alias:
|
416
|
+
EnforcedStyle: prefer_alias_method
|
417
|
+
|
418
|
+
Style/AndOr:
|
419
|
+
Description: "Use &&/|| instead of and/or."
|
420
|
+
StyleGuide: "https://github.com/bbatsov/ruby-style-guide#no-and-or-or"
|
421
|
+
EnforcedStyle: conditionals
|
422
|
+
|
423
|
+
Style/BlockDelimiters:
|
424
|
+
Description: "Use {…} for one line blocks and do…end for multiline blocks."
|
425
|
+
EnforcedStyle: line_count_based
|
426
|
+
|
427
|
+
Style/BracesAroundHashParameters:
|
428
|
+
EnforcedStyle: no_braces
|
429
|
+
|
430
|
+
Style/ClassAndModuleChildren:
|
431
|
+
EnforcedStyle: compact
|
432
|
+
Enabled: false # What style to enforce has not been decided
|
433
|
+
|
434
|
+
Style/ClassCheck:
|
435
|
+
EnforcedStyle: is_a?
|
436
|
+
|
437
|
+
Style/CollectionMethods:
|
438
|
+
PreferredMethods:
|
439
|
+
collect: "map"
|
440
|
+
collect!: "map!"
|
441
|
+
inject: "reduce"
|
442
|
+
detect: "find"
|
443
|
+
find_all: "select"
|
444
|
+
|
445
|
+
Style/CommandLiteral:
|
446
|
+
EnforcedStyle: percent_x
|
447
|
+
AllowInnerBackticks: false
|
448
|
+
|
449
|
+
Style/CommentAnnotation:
|
450
|
+
Keywords:
|
451
|
+
- TODO
|
452
|
+
- FIXME
|
453
|
+
- OPTIMIZE
|
454
|
+
- HACK
|
455
|
+
- REVIEW
|
456
|
+
|
457
|
+
Style/EmptyElse:
|
458
|
+
EnforcedStyle: both
|
459
|
+
|
460
|
+
Style/EmptyMethod:
|
461
|
+
EnforcedStyle: expanded
|
462
|
+
|
463
|
+
Style/Encoding:
|
464
|
+
Enabled: true
|
465
|
+
|
466
|
+
Style/For:
|
467
|
+
EnforcedStyle: each
|
468
|
+
|
469
|
+
Style/FormatString:
|
470
|
+
Description: "bad: `'%d %d' % [20, 10].` ok: `format('%<first>d %<second>d', first: 20, second: 10)`"
|
471
|
+
StyleGuide: "https://github.com/bbatsov/ruby-style-guide#sprintf"
|
472
|
+
EnforcedStyle: format
|
473
|
+
|
474
|
+
Style/GlobalVars:
|
475
|
+
AllowedVariables:
|
476
|
+
- autogen_filepath
|
477
|
+
- autogen_buffer
|
478
|
+
|
479
|
+
Style/HashSyntax:
|
480
|
+
Description: "{ a: 1, b: 2 } { :a => 1, :b => 2 }."
|
481
|
+
StyleGuide: "https://github.com/bbatsov/ruby-style-guide#hash-literals"
|
482
|
+
EnforcedStyle: ruby19_no_mixed_keys
|
483
|
+
|
484
|
+
Style/Lambda:
|
485
|
+
EnforcedStyle: literal
|
486
|
+
|
487
|
+
Style/LambdaCall:
|
488
|
+
EnforcedStyle: call
|
489
|
+
|
490
|
+
Style/MethodDefParentheses:
|
491
|
+
EnforcedStyle: require_parentheses
|
492
|
+
|
493
|
+
Style/ModuleFunction:
|
494
|
+
Description: "Checks for usage of `extend self` in modules."
|
495
|
+
StyleGuide: "https://github.com/bbatsov/ruby-style-guide#module-function"
|
496
|
+
EnforcedStyle: module_function
|
497
|
+
|
498
|
+
Style/NonNilCheck:
|
499
|
+
Description: "Checks for redundant nil checks."
|
500
|
+
StyleGuide: "https://github.com/bbatsov/ruby-style-guide#no-non-nil-checks"
|
501
|
+
IncludeSemanticChanges: true
|
502
|
+
|
503
|
+
Style/ParenthesesAroundCondition:
|
504
|
+
AllowSafeAssignment: true
|
505
|
+
|
506
|
+
Style/PercentLiteralDelimiters:
|
507
|
+
PreferredDelimiters:
|
508
|
+
default: ()
|
509
|
+
"%i": "[]"
|
510
|
+
"%I": "[]"
|
511
|
+
"%r": "{}"
|
512
|
+
"%w": "[]"
|
513
|
+
"%W": "[]"
|
514
|
+
"%Q": "{}"
|
515
|
+
|
516
|
+
Style/PercentQLiterals:
|
517
|
+
EnforcedStyle: upper_case_q
|
518
|
+
|
519
|
+
Style/RaiseArgs:
|
520
|
+
Description: "raise SomeException, 'message' over raise SomeException.new('message')."
|
521
|
+
StyleGuide: "https://github.com/bbatsov/ruby-style-guide#exception-class-messages"
|
522
|
+
EnforcedStyle: exploded
|
523
|
+
|
524
|
+
Style/RedundantReturn:
|
525
|
+
AllowMultipleReturnValues: false
|
526
|
+
|
527
|
+
Style/RegexpLiteral:
|
528
|
+
Enabled: false
|
529
|
+
|
530
|
+
Style/Semicolon:
|
531
|
+
AllowAsExpressionSeparator: false
|
532
|
+
|
533
|
+
Style/SingleLineBlockParams:
|
534
|
+
Methods:
|
535
|
+
- reduce:
|
536
|
+
- acc
|
537
|
+
- elem
|
538
|
+
- inject:
|
539
|
+
- acc
|
540
|
+
- elem
|
541
|
+
|
542
|
+
Style/SingleLineMethods:
|
543
|
+
AllowIfMethodIsEmpty: false
|
544
|
+
|
545
|
+
Style/SpecialGlobalVars:
|
546
|
+
EnforcedStyle: use_english_names
|
547
|
+
|
548
|
+
Style/StabbyLambdaParentheses:
|
549
|
+
EnforcedStyle: require_parentheses
|
550
|
+
|
551
|
+
Style/StringLiterals:
|
552
|
+
EnforcedStyle: double_quotes
|
553
|
+
|
554
|
+
Style/StringLiteralsInInterpolation:
|
555
|
+
EnforcedStyle: double_quotes
|
556
|
+
|
557
|
+
Style/StringMethods:
|
558
|
+
PreferredMethods:
|
559
|
+
intern: to_sym
|
560
|
+
|
561
|
+
Style/BarePercentLiterals:
|
562
|
+
EnforcedStyle: percent_q
|
563
|
+
|
564
|
+
Style/SymbolArray:
|
565
|
+
EnforcedStyle: percent
|
566
|
+
|
567
|
+
Style/TernaryParentheses:
|
568
|
+
EnforcedStyle: require_no_parentheses
|
569
|
+
|
570
|
+
Style/TrailingCommaInArguments:
|
571
|
+
EnforcedStyleForMultiline: no_comma
|
572
|
+
|
573
|
+
Style/TrailingCommaInLiteral:
|
574
|
+
EnforcedStyleForMultiline: no_comma
|
575
|
+
|
576
|
+
Style/WordArray:
|
577
|
+
EnforcedStyle: percent
|
578
|
+
|
579
|
+
Style/GuardClause:
|
580
|
+
Description: "Enforces early return guard clauses"
|
581
|
+
StyleGuide: "https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals"
|
582
|
+
Enabled: false
|
583
|
+
|
584
|
+
Style/MethodMissing:
|
585
|
+
Enabled: true
|
586
|
+
|
587
|
+
Style/SymbolProc:
|
588
|
+
Enabled: true
|
589
|
+
|
590
|
+
Style/MultilineIfModifier:
|
591
|
+
StyleGuide: "http://www.rubydoc.info/gems/rubocop/0.45.0/RuboCop/Cop/Style/MultilineIfModifier"
|
592
|
+
Enabled: false # I think there are cases where this is OK…
|
593
|
+
|
594
|
+
Style/TrailingUnderscoreVariable:
|
595
|
+
Enabled: false
|
596
|
+
|
597
|
+
Style/MixinUsage:
|
598
|
+
Enabled: true
|
599
|
+
|
600
|
+
Style/StderrPuts:
|
601
|
+
Exclude:
|
602
|
+
- bin/yarn
|
603
|
+
|
604
|
+
Style/BlockComments:
|
605
|
+
Enabled: false # Just for big blocks, ok?
|
606
|
+
|
607
|
+
Style/FrozenStringLiteralComment:
|
608
|
+
EnforcedStyle: always
|
609
|
+
|
610
|
+
Style/MutableConstant:
|
611
|
+
Enabled: true
|
612
|
+
|
613
|
+
Style/Next:
|
614
|
+
Enabled: false
|
615
|
+
|
616
|
+
# -- Rails
|
617
|
+
|
618
|
+
Rails/Date:
|
619
|
+
EnforcedStyle: flexible
|
620
|
+
# Flexible allows us to use the shorthand `Date.current` instead of `Time.zone.today`,
|
621
|
+
# just as we would use `Time.current` over `Time.zone.now`.
|
622
|
+
|
623
|
+
Rails/TimeZone:
|
624
|
+
Description: "bad: `Time.now, Time.parse` ok: `Time.zone, Time.current, Time.in_time_zone`"
|
625
|
+
EnforcedStyle: flexible
|
626
|
+
|
627
|
+
Rails/NotNullColumn:
|
628
|
+
Enabled: false # see https://github.com/bbatsov/rubocop/issues/3963
|
629
|
+
|
630
|
+
Rails/FindBy:
|
631
|
+
Description: "Prefer find_by(name: name) over find_by_name(name)"
|
632
|
+
|
633
|
+
Rails/FindEach:
|
634
|
+
Description: "Prefer all.find_each over all.find for batch queries."
|
635
|
+
|
636
|
+
Rails/HasAndBelongsToMany:
|
637
|
+
Description: "Prefer has_many :through to has_and_belongs_to_many."
|
638
|
+
|
639
|
+
Rails/RequestReferer:
|
640
|
+
Description: "bad: `request.referrer` ok: `request.referer`."
|
641
|
+
EnforcedStyle: referer
|
642
|
+
|
643
|
+
Rails/OutputSafety:
|
644
|
+
Description: "bad: `html_safe, raw` ok: `safe_join`."
|
645
|
+
Enabled: false
|
646
|
+
|
647
|
+
Rails/Output:
|
648
|
+
Description: "Checks for calls to puts, print, etc."
|
649
|
+
Exclude:
|
650
|
+
- lib/tasks/*
|
651
|
+
|
652
|
+
Rails/SkipsModelValidations:
|
653
|
+
Description: "bad: `update_attribute` ok: `update_attributes`."
|
654
|
+
Enabled: true
|
655
|
+
Exclude:
|
656
|
+
- spec/**/*_spec.rb # Sometimes needed to setup invalid stats for tests.
|
657
|
+
|
658
|
+
Rails/DynamicFindBy:
|
659
|
+
Enabled: true
|
660
|
+
|
661
|
+
Rails/Exit:
|
662
|
+
Exclude:
|
663
|
+
- lib/tasks/*
|
664
|
+
|
665
|
+
Bundler/OrderedGems:
|
666
|
+
Enabled: false # or we can make groups that makes sense
|
667
|
+
|
668
|
+
# -- RSpec
|
669
|
+
|
670
|
+
RSpec/EmptyLineAfterFinalLet:
|
671
|
+
Enabled: true
|
672
|
+
|
673
|
+
RSpec/DescribedClass:
|
674
|
+
Description: "Forces usage of described_class"
|
675
|
+
Enabled: false
|
676
|
+
|
677
|
+
RSpec/DescribeClass:
|
678
|
+
Description: "Requires top-level describe to contained tested contant"
|
679
|
+
Enabled: true
|
680
|
+
|
681
|
+
RSpec/AnyInstance:
|
682
|
+
Enabled: true
|
683
|
+
|
684
|
+
RSpec/ExampleLength:
|
685
|
+
Enabled: true
|
686
|
+
Max: 30
|
687
|
+
|
688
|
+
RSpec/MultipleExpectations:
|
689
|
+
Enabled: false
|
690
|
+
# We trust ourselves to know when it's OK to
|
691
|
+
# have more than one expectation per spec.
|
692
|
+
|
693
|
+
RSpec/ExpectActual:
|
694
|
+
Enabled: true
|
695
|
+
|
696
|
+
RSpec/RepeatedExample:
|
697
|
+
Enabled: true
|
698
|
+
|
699
|
+
RSpec/VerifiedDoubles:
|
700
|
+
Enabled: false
|
701
|
+
# `instance_double` is randomly not finding deliver_now:
|
702
|
+
# e.g: "the VgDonationMailer class does not implement the instance method: deliver_now"
|
703
|
+
|
704
|
+
RSpec/MessageSpies:
|
705
|
+
Enabled: true
|
706
|
+
|
707
|
+
RSpec/NestedGroups:
|
708
|
+
Enabled: true
|
709
|
+
Max: 5
|
710
|
+
|
711
|
+
RSpec/HookArgument:
|
712
|
+
Enabled: true
|
713
|
+
|
714
|
+
RSpec/NotToNot:
|
715
|
+
Enabled: true
|
716
|
+
|
717
|
+
RSpec/EmptyLineAfterSubject:
|
718
|
+
Enabled: true
|