vedeu 0.4.11 → 0.4.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +736 -0
  3. data/Rakefile +7 -0
  4. data/bin/vedeu_drb_server +1 -1
  5. data/config/rubocop_disabled.yml +50 -0
  6. data/config/rubocop_enabled.yml +1044 -0
  7. data/examples/borders_app.rb +3 -1
  8. data/examples/colours_app.rb +3 -1
  9. data/examples/configuration_app.rb +1 -1
  10. data/examples/cursor_app.rb +4 -1
  11. data/examples/drb_app.rb +3 -1
  12. data/examples/focus_app.rb +1 -1
  13. data/examples/geometry_app.rb +3 -1
  14. data/examples/hello_world.rb +3 -1
  15. data/examples/lines_app.rb +3 -1
  16. data/examples/typed_commands/typed_commands_app.rb +1 -1
  17. data/examples/view_templates_app/view_templates_app.rb +3 -1
  18. data/lib/vedeu/api.rb +4 -3
  19. data/lib/vedeu/bindings.rb +1 -1
  20. data/lib/vedeu/configuration/api.rb +1 -1
  21. data/lib/vedeu/configuration/cli.rb +3 -2
  22. data/lib/vedeu/configuration/configuration.rb +1 -1
  23. data/lib/vedeu/cursor/cursor.rb +2 -2
  24. data/lib/vedeu/cursor/refresh_cursor.rb +3 -1
  25. data/lib/vedeu/distributed/templates/default_configuration.vedeu +1 -1
  26. data/lib/vedeu/events/event.rb +3 -5
  27. data/lib/vedeu/geometry/position.rb +1 -1
  28. data/lib/vedeu/input/all.rb +1 -1
  29. data/lib/vedeu/input/key.rb +5 -8
  30. data/lib/vedeu/models/all.rb +9 -12
  31. data/lib/vedeu/models/interface.rb +1 -1
  32. data/lib/vedeu/models/menu.rb +1 -1
  33. data/lib/vedeu/output/border.rb +18 -14
  34. data/lib/vedeu/output/clear.rb +10 -3
  35. data/lib/vedeu/output/esc.rb +4 -14
  36. data/lib/vedeu/output/html_char.rb +11 -7
  37. data/lib/vedeu/output/null_border.rb +10 -0
  38. data/lib/vedeu/output/presentation.rb +6 -22
  39. data/lib/vedeu/output/refresh.rb +0 -11
  40. data/lib/vedeu/output/renderers/terminal_renderer.rb +1 -1
  41. data/lib/vedeu/output/translator.rb +5 -5
  42. data/lib/vedeu/output/viewport.rb +12 -9
  43. data/lib/vedeu/repositories/collections.rb +6 -0
  44. data/lib/vedeu/support/visible.rb +17 -12
  45. data/lib/vedeu/traps.rb +3 -3
  46. data/test/lib/vedeu/configuration/cli_test.rb +1 -1
  47. data/test/lib/vedeu/output/null_border_test.rb +14 -0
  48. data/test/lib/vedeu/output/refresh_test.rb +0 -21
  49. data/test/lib/vedeu/support/coercions_test.rb +5 -5
  50. data/test/lib/vedeu/support/common_test.rb +1 -1
  51. data/test/lib/vedeu/support/visible_test.rb +10 -5
  52. data/test/test_helper.rb +2 -2
  53. data/vedeu.gemspec +3 -2
  54. metadata +22 -5
@@ -0,0 +1,1044 @@
1
+ # These are all the cops that are enabled in the default configuration.
2
+
3
+ Style/AccessModifierIndentation:
4
+ Description: Check indentation of private/protected visibility modifiers.
5
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#indent-public-private-protected'
6
+ Enabled: true
7
+
8
+ Style/AccessorMethodName:
9
+ Description: Check the naming of accessor methods for get_/set_.
10
+ Enabled: true
11
+
12
+ Style/Alias:
13
+ Description: 'Use alias_method instead of alias.'
14
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#alias-method'
15
+ Enabled: true
16
+
17
+ Style/AlignArray:
18
+ Description: >-
19
+ Align the elements of an array literal if they span more than
20
+ one line.
21
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#align-multiline-arrays'
22
+ Enabled: true
23
+
24
+ Style/AlignHash:
25
+ Description: >-
26
+ Align the elements of a hash literal if they span more than
27
+ one line.
28
+ Enabled: true
29
+
30
+ Style/AlignParameters:
31
+ Description: >-
32
+ Align the parameters of a method call if they span more
33
+ than one line.
34
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-double-indent'
35
+ Enabled: true
36
+
37
+ Style/AndOr:
38
+ Description: 'Use &&/|| instead of and/or.'
39
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-and-or-or'
40
+ Enabled: true
41
+
42
+ Style/ArrayJoin:
43
+ Description: 'Use Array#join instead of Array#*.'
44
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#array-join'
45
+ Enabled: true
46
+
47
+ Style/AsciiComments:
48
+ Description: 'Use only ascii symbols in comments.'
49
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-comments'
50
+ Enabled: true
51
+
52
+ Style/AsciiIdentifiers:
53
+ Description: 'Use only ascii symbols in identifiers.'
54
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-identifiers'
55
+ Enabled: true
56
+
57
+ Style/Attr:
58
+ Description: 'Checks for uses of Module#attr.'
59
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr'
60
+ Enabled: true
61
+
62
+ Style/BeginBlock:
63
+ Description: 'Avoid the use of BEGIN blocks.'
64
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-BEGIN-blocks'
65
+ Enabled: true
66
+
67
+ Style/BarePercentLiterals:
68
+ Description: 'Checks if usage of %() or %Q() matches configuration.'
69
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-q-shorthand'
70
+ Enabled: true
71
+
72
+ Style/BlockComments:
73
+ Description: 'Do not use block comments.'
74
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-block-comments'
75
+ Enabled: true
76
+
77
+ Style/BlockEndNewline:
78
+ Description: 'Put end statement of multiline block on its own line.'
79
+ Enabled: true
80
+
81
+ Style/Blocks:
82
+ Description: >-
83
+ Avoid using {...} for multi-line blocks (multiline chaining is
84
+ always ugly).
85
+ Prefer {...} over do...end for single-line blocks.
86
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks'
87
+ Enabled: true
88
+
89
+ Style/BracesAroundHashParameters:
90
+ Description: 'Enforce braces style around hash parameters.'
91
+ Enabled: true
92
+
93
+ Style/CaseEquality:
94
+ Description: 'Avoid explicit use of the case equality operator(===).'
95
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-case-equality'
96
+ Enabled: true
97
+
98
+ Style/CaseIndentation:
99
+ Description: 'Indentation of when in a case/when/[else/]end.'
100
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#indent-when-to-case'
101
+ Enabled: true
102
+
103
+ Style/CharacterLiteral:
104
+ Description: 'Checks for uses of character literals.'
105
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-character-literals'
106
+ Enabled: true
107
+
108
+ Style/ClassAndModuleCamelCase:
109
+ Description: 'Use CamelCase for classes and modules.'
110
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#camelcase-classes'
111
+ Enabled: true
112
+
113
+ Style/ClassAndModuleChildren:
114
+ Description: 'Checks style of children classes and modules.'
115
+ Enabled: true
116
+
117
+ Style/ClassCheck:
118
+ Description: 'Enforces consistent use of `Object#is_a?` or `Object#kind_of?`.'
119
+ Enabled: true
120
+
121
+ Style/ClassMethods:
122
+ Description: 'Use self when defining module/class methods.'
123
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#def-self-singletons'
124
+ Enabled: true
125
+
126
+ Style/ClassVars:
127
+ Description: 'Avoid the use of class variables.'
128
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-class-vars'
129
+ Enabled: true
130
+
131
+ Style/ColonMethodCall:
132
+ Description: 'Do not use :: for method call.'
133
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#double-colons'
134
+ Enabled: true
135
+
136
+ Style/CommandLiteral:
137
+ Description: 'Use `` or %x around command literals.'
138
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-x'
139
+ Enabled: true
140
+
141
+ Style/CommentAnnotation:
142
+ Description: >-
143
+ Checks formatting of special comments
144
+ (TODO, FIXME, OPTIMIZE, HACK, REVIEW).
145
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#annotate-keywords'
146
+ Enabled: true
147
+
148
+ Style/CommentIndentation:
149
+ Description: 'Indentation of comments.'
150
+ Enabled: true
151
+
152
+ Style/ConstantName:
153
+ Description: 'Constants should use SCREAMING_SNAKE_CASE.'
154
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#screaming-snake-case'
155
+ Enabled: true
156
+
157
+ Style/DefWithParentheses:
158
+ Description: 'Use def with parentheses when there are arguments.'
159
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#method-parens'
160
+ Enabled: true
161
+
162
+ Style/DeprecatedHashMethods:
163
+ Description: 'Checks for use of deprecated Hash methods.'
164
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-key'
165
+ Enabled: true
166
+
167
+ Style/Documentation:
168
+ Description: 'Document classes and non-namespace modules.'
169
+ Enabled: true
170
+
171
+ Style/DotPosition:
172
+ Description: 'Checks the position of the dot in multi-line method calls.'
173
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains'
174
+ Enabled: true
175
+
176
+ Style/DoubleNegation:
177
+ Description: 'Checks for uses of double negation (!!).'
178
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-bang-bang'
179
+ Enabled: true
180
+
181
+ Style/EachWithObject:
182
+ Description: 'Prefer `each_with_object` over `inject` or `reduce`.'
183
+ Enabled: true
184
+
185
+ Style/ElseAlignment:
186
+ Description: 'Align elses and elsifs correctly.'
187
+ Enabled: true
188
+
189
+ Style/EmptyElse:
190
+ Description: 'Avoid empty else-clauses.'
191
+ Enabled: true
192
+
193
+ Style/EmptyLineBetweenDefs:
194
+ Description: 'Use empty lines between defs.'
195
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#empty-lines-between-methods'
196
+ Enabled: true
197
+
198
+ Style/EmptyLines:
199
+ Description: "Don't use several empty lines in a row."
200
+ Enabled: true
201
+
202
+ Style/EmptyLinesAroundAccessModifier:
203
+ Description: "Keep blank lines around access modifiers."
204
+ Enabled: true
205
+
206
+ Style/EmptyLinesAroundBlockBody:
207
+ Description: "Keeps track of empty lines around block bodies."
208
+ Enabled: true
209
+
210
+ Style/EmptyLinesAroundClassBody:
211
+ Description: "Keeps track of empty lines around class bodies."
212
+ Enabled: true
213
+
214
+ Style/EmptyLinesAroundModuleBody:
215
+ Description: "Keeps track of empty lines around module bodies."
216
+ Enabled: true
217
+
218
+ Style/EmptyLinesAroundMethodBody:
219
+ Description: "Keeps track of empty lines around method bodies."
220
+ Enabled: true
221
+
222
+ Style/EmptyLiteral:
223
+ Description: 'Prefer literals to Array.new/Hash.new/String.new.'
224
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#literal-array-hash'
225
+ Enabled: true
226
+
227
+ Style/EndBlock:
228
+ Description: 'Avoid the use of END blocks.'
229
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-END-blocks'
230
+ Enabled: true
231
+
232
+ Style/EndOfLine:
233
+ Description: 'Use Unix-style line endings.'
234
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#crlf'
235
+ Enabled: true
236
+
237
+ Style/EvenOdd:
238
+ Description: 'Favor the use of Fixnum#even? && Fixnum#odd?'
239
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods'
240
+ Enabled: true
241
+
242
+ Style/FileName:
243
+ Description: 'Use snake_case for source file names.'
244
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-files'
245
+ Enabled: true
246
+
247
+ Style/FirstParameterIndentation:
248
+ Description: 'Checks the indentation of the first parameter in a method call.'
249
+ Enabled: true
250
+
251
+ Style/FlipFlop:
252
+ Description: 'Checks for flip flops'
253
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-flip-flops'
254
+ Enabled: true
255
+
256
+ Style/For:
257
+ Description: 'Checks use of for or each in multiline loops.'
258
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-for-loops'
259
+ Enabled: true
260
+
261
+ Style/FormatString:
262
+ Description: 'Enforce the use of Kernel#sprintf, Kernel#format or String#%.'
263
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#sprintf'
264
+ Enabled: true
265
+
266
+ Style/GlobalVars:
267
+ Description: 'Do not introduce global variables.'
268
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#instance-vars'
269
+ Enabled: true
270
+
271
+ Style/GuardClause:
272
+ Description: 'Check for conditionals that can be replaced with guard clauses'
273
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals'
274
+ Enabled: true
275
+
276
+ Style/HashSyntax:
277
+ Description: >-
278
+ Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax
279
+ { :a => 1, :b => 2 }.
280
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-literals'
281
+ Enabled: true
282
+
283
+ Style/IfUnlessModifier:
284
+ Description: >-
285
+ Favor modifier if/unless usage when you have a
286
+ single-line body.
287
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier'
288
+ Enabled: true
289
+
290
+ Style/IfWithSemicolon:
291
+ Description: 'Do not use if x; .... Use the ternary operator instead.'
292
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-semicolon-ifs'
293
+ Enabled: true
294
+
295
+ Style/IndentationConsistency:
296
+ Description: 'Keep indentation straight.'
297
+ Enabled: true
298
+
299
+ Style/IndentationWidth:
300
+ Description: 'Use 2 spaces for indentation.'
301
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-indentation'
302
+ Enabled: true
303
+
304
+ Style/IndentArray:
305
+ Description: >-
306
+ Checks the indentation of the first element in an array
307
+ literal.
308
+ Enabled: true
309
+
310
+ Style/IndentHash:
311
+ Description: 'Checks the indentation of the first key in a hash literal.'
312
+ Enabled: true
313
+
314
+ Style/InfiniteLoop:
315
+ Description: 'Use Kernel#loop for infinite loops.'
316
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#infinite-loop'
317
+ Enabled: true
318
+
319
+ Style/Lambda:
320
+ Description: 'Use the new lambda literal syntax for single-line blocks.'
321
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#lambda-multi-line'
322
+ Enabled: true
323
+
324
+ Style/LambdaCall:
325
+ Description: 'Use lambda.call(...) instead of lambda.(...).'
326
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc-call'
327
+ Enabled: true
328
+
329
+ Style/LeadingCommentSpace:
330
+ Description: 'Comments should start with a space.'
331
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-space'
332
+ Enabled: true
333
+
334
+ Style/LineEndConcatenation:
335
+ Description: >-
336
+ Use \ instead of + or << to concatenate two string literals at
337
+ line end.
338
+ Enabled: true
339
+
340
+ Style/MethodCallParentheses:
341
+ Description: 'Do not use parentheses for method calls with no arguments.'
342
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-args-no-parens'
343
+ Enabled: true
344
+
345
+ Style/MethodDefParentheses:
346
+ Description: >-
347
+ Checks if the method definitions have or don't have
348
+ parentheses.
349
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#method-parens'
350
+ Enabled: true
351
+
352
+ Style/MethodName:
353
+ Description: 'Use the configured style when naming methods.'
354
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-symbols-methods-vars'
355
+ Enabled: true
356
+
357
+ Style/ModuleFunction:
358
+ Description: 'Checks for usage of `extend self` in modules.'
359
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#module-function'
360
+ Enabled: true
361
+
362
+ Style/MultilineBlockChain:
363
+ Description: 'Avoid multi-line chains of blocks.'
364
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks'
365
+ Enabled: true
366
+
367
+ Style/MultilineBlockLayout:
368
+ Description: 'Ensures newlines after multiline block do statements.'
369
+ Enabled: false
370
+
371
+ Style/MultilineIfThen:
372
+ Description: 'Do not use then for multi-line if/unless.'
373
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-then'
374
+ Enabled: true
375
+
376
+ Style/MultilineOperationIndentation:
377
+ Description: >-
378
+ Checks indentation of binary operations that span more than
379
+ one line.
380
+ Enabled: true
381
+
382
+ Style/MultilineTernaryOperator:
383
+ Description: >-
384
+ Avoid multi-line ?: (the ternary operator);
385
+ use if/unless instead.
386
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-multiline-ternary'
387
+ Enabled: true
388
+
389
+ Style/NegatedIf:
390
+ Description: >-
391
+ Favor unless over if for negative conditions
392
+ (or control flow or).
393
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#unless-for-negatives'
394
+ Enabled: true
395
+
396
+ Style/NegatedWhile:
397
+ Description: 'Favor until over while for negative conditions.'
398
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#until-for-negatives'
399
+ Enabled: true
400
+
401
+ Style/NestedTernaryOperator:
402
+ Description: 'Use one expression per branch in a ternary operator.'
403
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-ternary'
404
+ Enabled: true
405
+
406
+ Style/Next:
407
+ Description: 'Use `next` to skip iteration instead of a condition at the end.'
408
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals'
409
+ Enabled: true
410
+
411
+ Style/NilComparison:
412
+ Description: 'Prefer x.nil? to x == nil.'
413
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods'
414
+ Enabled: true
415
+
416
+ Style/NonNilCheck:
417
+ Description: 'Checks for redundant nil checks.'
418
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-non-nil-checks'
419
+ Enabled: true
420
+
421
+ Style/Not:
422
+ Description: 'Use ! instead of not.'
423
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bang-not-not'
424
+ Enabled: true
425
+
426
+ Style/NumericLiterals:
427
+ Description: >-
428
+ Add underscores to large numeric literals to improve their
429
+ readability.
430
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscores-in-numerics'
431
+ Enabled: true
432
+
433
+ Style/OneLineConditional:
434
+ Description: >-
435
+ Favor the ternary operator(?:) over
436
+ if/then/else/end constructs.
437
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#ternary-operator'
438
+ Enabled: true
439
+
440
+ Style/OpMethod:
441
+ Description: 'When defining binary operators, name the argument other.'
442
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#other-arg'
443
+ Enabled: true
444
+
445
+ Style/ParenthesesAroundCondition:
446
+ Description: >-
447
+ Don't use parentheses around the condition of an
448
+ if/unless/while.
449
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-parens-if'
450
+ Enabled: true
451
+
452
+ Style/PercentLiteralDelimiters:
453
+ Description: 'Use `%`-literal delimiters consistently'
454
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-literal-braces'
455
+ Enabled: true
456
+
457
+ Style/PercentQLiterals:
458
+ Description: 'Checks if uses of %Q/%q match the configured preference.'
459
+ Enabled: true
460
+
461
+ Style/PerlBackrefs:
462
+ Description: 'Avoid Perl-style regex back references.'
463
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers'
464
+ Enabled: true
465
+
466
+ Style/PredicateName:
467
+ Description: 'Check the names of predicate methods.'
468
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark'
469
+ Enabled: true
470
+
471
+ Style/Proc:
472
+ Description: 'Use proc instead of Proc.new.'
473
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc'
474
+ Enabled: true
475
+
476
+ Style/RaiseArgs:
477
+ Description: 'Checks the arguments passed to raise/fail.'
478
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#exception-class-messages'
479
+ Enabled: true
480
+
481
+ Style/RedundantBegin:
482
+ Description: "Don't use begin blocks when they are not needed."
483
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#begin-implicit'
484
+ Enabled: true
485
+
486
+ Style/RedundantException:
487
+ Description: "Checks for an obsolete RuntimeException argument in raise/fail."
488
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-explicit-runtimeerror'
489
+ Enabled: true
490
+
491
+ Style/RedundantReturn:
492
+ Description: "Don't use return where it's not required."
493
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-explicit-return'
494
+ Enabled: true
495
+
496
+ Style/RedundantSelf:
497
+ Description: "Don't use self where it's not needed."
498
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-self-unless-required'
499
+ Enabled: true
500
+
501
+ Style/RegexpLiteral:
502
+ Description: 'Use / or %r around regular expressions.'
503
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-r'
504
+ Enabled: true
505
+
506
+ Style/RescueModifier:
507
+ Description: 'Avoid using rescue in its modifier form.'
508
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-rescue-modifiers'
509
+ Enabled: true
510
+
511
+ Style/SelfAssignment:
512
+ Description: >-
513
+ Checks for places where self-assignment shorthand should have
514
+ been used.
515
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#self-assignment'
516
+ Enabled: true
517
+
518
+ Style/Semicolon:
519
+ Description: "Don't use semicolons to terminate expressions."
520
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-semicolon'
521
+ Enabled: true
522
+
523
+ Style/SignalException:
524
+ Description: 'Checks for proper usage of fail and raise.'
525
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#fail-method'
526
+ Enabled: true
527
+
528
+ Style/SingleLineBlockParams:
529
+ Description: 'Enforces the names of some block params.'
530
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#reduce-blocks'
531
+ Enabled: true
532
+
533
+ Style/SingleLineMethods:
534
+ Description: 'Avoid single-line methods.'
535
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-single-line-methods'
536
+ Enabled: true
537
+
538
+ Style/SingleSpaceBeforeFirstArg:
539
+ Description: >-
540
+ Checks that exactly one space is used between a method name
541
+ and the first argument for method calls without parentheses.
542
+ Enabled: false
543
+
544
+ Style/SpaceAfterColon:
545
+ Description: 'Use spaces after colons.'
546
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
547
+ Enabled: true
548
+
549
+ Style/SpaceAfterComma:
550
+ Description: 'Use spaces after commas.'
551
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
552
+ Enabled: true
553
+
554
+ Style/SpaceAfterControlKeyword:
555
+ Description: 'Use spaces after if/elsif/unless/while/until/case/when.'
556
+ Enabled: true
557
+
558
+ Style/SpaceAfterMethodName:
559
+ Description: >-
560
+ Do not put a space between a method name and the opening
561
+ parenthesis in a method definition.
562
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-no-spaces'
563
+ Enabled: true
564
+
565
+ Style/SpaceAfterNot:
566
+ Description: Tracks redundant space after the ! operator.
567
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-space-bang'
568
+ Enabled: true
569
+
570
+ Style/SpaceAfterSemicolon:
571
+ Description: 'Use spaces after semicolons.'
572
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
573
+ Enabled: true
574
+
575
+ Style/SpaceBeforeBlockBraces:
576
+ Description: >-
577
+ Checks that the left block brace has or doesn't have space
578
+ before it.
579
+ Enabled: true
580
+
581
+ Style/SpaceBeforeComma:
582
+ Description: 'No spaces before commas.'
583
+ Enabled: true
584
+
585
+ Style/SpaceBeforeComment:
586
+ Description: >-
587
+ Checks for missing space between code and a comment on the
588
+ same line.
589
+ Enabled: true
590
+
591
+ Style/SpaceBeforeSemicolon:
592
+ Description: 'No spaces before semicolons.'
593
+ Enabled: true
594
+
595
+ Style/SpaceInsideBlockBraces:
596
+ Description: >-
597
+ Checks that block braces have or don't have surrounding space.
598
+ For blocks taking parameters, checks that the left brace has
599
+ or doesn't have trailing space.
600
+ Enabled: true
601
+
602
+ Style/SpaceAroundBlockParameters:
603
+ Description: 'Checks the spacing inside and after block parameters pipes.'
604
+ Enabled: true
605
+
606
+ Style/SpaceAroundEqualsInParameterDefault:
607
+ Description: >-
608
+ Checks that the equals signs in parameter default assignments
609
+ have or don't have surrounding space depending on
610
+ configuration.
611
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-around-equals'
612
+ Enabled: true
613
+
614
+ Style/SpaceAroundOperators:
615
+ Description: 'Use a single space around operators.'
616
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
617
+ Enabled: true
618
+
619
+ Style/SpaceBeforeModifierKeyword:
620
+ Description: 'Put a space before the modifier keyword.'
621
+ Enabled: true
622
+
623
+ Style/SpaceInsideBrackets:
624
+ Description: 'No spaces after [ or before ].'
625
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-spaces-braces'
626
+ Enabled: true
627
+
628
+ Style/SpaceInsideHashLiteralBraces:
629
+ Description: "Use spaces inside hash literal braces - or don't."
630
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
631
+ Enabled: true
632
+
633
+ Style/SpaceInsideParens:
634
+ Description: 'No spaces after ( or before ).'
635
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-spaces-braces'
636
+ Enabled: true
637
+
638
+ Style/SpaceInsideRangeLiteral:
639
+ Description: 'No spaces inside range literals.'
640
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-space-inside-range-literals'
641
+ Enabled: true
642
+
643
+ Style/SpecialGlobalVars:
644
+ Description: 'Avoid Perl-style global variables.'
645
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-cryptic-perlisms'
646
+ Enabled: true
647
+
648
+ Style/StringLiterals:
649
+ Description: 'Checks if uses of quotes match the configured preference.'
650
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-string-literals'
651
+ Enabled: true
652
+
653
+ Style/StringLiteralsInInterpolation:
654
+ Description: >-
655
+ Checks if uses of quotes inside expressions in interpolated
656
+ strings match the configured preference.
657
+ Enabled: true
658
+
659
+ Style/StructInheritance:
660
+ Description: 'Checks for inheritance from Struct.new.'
661
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-extend-struct-new'
662
+ Enabled: true
663
+
664
+ Style/SymbolLiteral:
665
+ Description: 'Use plain symbols instead of string symbols when possible.'
666
+ Enabled: true
667
+
668
+ Style/SymbolProc:
669
+ Description: 'Use symbols as procs instead of blocks when possible.'
670
+ Enabled: true
671
+
672
+ Style/Tab:
673
+ Description: 'No hard tabs.'
674
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-indentation'
675
+ Enabled: true
676
+
677
+ Style/TrailingBlankLines:
678
+ Description: 'Checks trailing blank lines and final newline.'
679
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#newline-eof'
680
+ Enabled: true
681
+
682
+ Style/TrailingComma:
683
+ Description: 'Checks for trailing comma in parameter lists and literals.'
684
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
685
+ Enabled: true
686
+
687
+ Style/TrailingWhitespace:
688
+ Description: 'Avoid trailing whitespace.'
689
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-whitespace'
690
+ Enabled: true
691
+
692
+ Style/TrivialAccessors:
693
+ Description: 'Prefer attr_* methods to trivial readers/writers.'
694
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr_family'
695
+ Enabled: true
696
+
697
+ Style/UnlessElse:
698
+ Description: >-
699
+ Do not use unless with else. Rewrite these with the positive
700
+ case first.
701
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-else-with-unless'
702
+ Enabled: true
703
+
704
+ Style/UnneededCapitalW:
705
+ Description: 'Checks for %W when interpolation is not needed.'
706
+ Enabled: true
707
+
708
+ Style/UnneededPercentQ:
709
+ Description: 'Checks for %q/%Q when single quotes or double quotes would do.'
710
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-q'
711
+ Enabled: true
712
+
713
+ Style/VariableInterpolation:
714
+ Description: >-
715
+ Don't interpolate global, instance and class variables
716
+ directly in strings.
717
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#curlies-interpolate'
718
+ Enabled: true
719
+
720
+ Style/VariableName:
721
+ Description: 'Use the configured style when naming variables.'
722
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-symbols-methods-vars'
723
+ Enabled: true
724
+
725
+ Style/WhenThen:
726
+ Description: 'Use when x then ... for one-line cases.'
727
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#one-line-cases'
728
+ Enabled: true
729
+
730
+ Style/WhileUntilDo:
731
+ Description: 'Checks for redundant do after while or until.'
732
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-multiline-while-do'
733
+ Enabled: true
734
+
735
+ Style/WhileUntilModifier:
736
+ Description: >-
737
+ Favor modifier while/until usage when you have a
738
+ single-line body.
739
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#while-as-a-modifier'
740
+ Enabled: true
741
+
742
+ Style/WordArray:
743
+ Description: 'Use %w or %W for arrays of words.'
744
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-w'
745
+ Enabled: true
746
+
747
+ #################### Metrics ################################
748
+
749
+ Metrics/AbcSize:
750
+ Description: >-
751
+ A calculated magnitude based on number of assignments,
752
+ branches, and conditions.
753
+ Enabled: true
754
+
755
+ Metrics/BlockNesting:
756
+ Description: 'Avoid excessive block nesting'
757
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#three-is-the-number-thou-shalt-count'
758
+ Enabled: true
759
+
760
+ Metrics/ClassLength:
761
+ Description: 'Avoid classes longer than 100 lines of code.'
762
+ Enabled: true
763
+
764
+ Metrics/CyclomaticComplexity:
765
+ Description: >-
766
+ A complexity metric that is strongly correlated to the number
767
+ of test cases needed to validate a method.
768
+ Enabled: true
769
+
770
+ Metrics/LineLength:
771
+ Description: 'Limit lines to 80 characters.'
772
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#80-character-limits'
773
+ Enabled: true
774
+
775
+ Metrics/MethodLength:
776
+ Description: 'Avoid methods longer than 10 lines of code.'
777
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#short-methods'
778
+ Enabled: true
779
+
780
+ Metrics/ParameterLists:
781
+ Description: 'Avoid parameter lists longer than three or four parameters.'
782
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#too-many-params'
783
+ Enabled: true
784
+
785
+ Metrics/PerceivedComplexity:
786
+ Description: >-
787
+ A complexity metric geared towards measuring complexity for a
788
+ human reader.
789
+ Enabled: true
790
+
791
+ #################### Lint ################################
792
+ ### Warnings
793
+
794
+ Lint/AmbiguousOperator:
795
+ Description: >-
796
+ Checks for ambiguous operators in the first argument of a
797
+ method invocation without parentheses.
798
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-as-args'
799
+ Enabled: true
800
+
801
+ Lint/AmbiguousRegexpLiteral:
802
+ Description: >-
803
+ Checks for ambiguous regexp literals in the first argument of
804
+ a method invocation without parenthesis.
805
+ Enabled: true
806
+
807
+ Lint/AssignmentInCondition:
808
+ Description: "Don't use assignment in conditions."
809
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition'
810
+ Enabled: true
811
+
812
+ Lint/BlockAlignment:
813
+ Description: 'Align block ends correctly.'
814
+ Enabled: true
815
+
816
+ Lint/ConditionPosition:
817
+ Description: >-
818
+ Checks for condition placed in a confusing position relative to
819
+ the keyword.
820
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#same-line-condition'
821
+ Enabled: true
822
+
823
+ Lint/Debugger:
824
+ Description: 'Check for debugger calls.'
825
+ Enabled: true
826
+
827
+ Lint/DefEndAlignment:
828
+ Description: 'Align ends corresponding to defs correctly.'
829
+ Enabled: true
830
+
831
+ Lint/DeprecatedClassMethods:
832
+ Description: 'Check for deprecated class method calls.'
833
+ Enabled: true
834
+
835
+ Lint/DuplicateMethods:
836
+ Description: 'Check for duplicate methods calls.'
837
+ Enabled: true
838
+
839
+ Lint/ElseLayout:
840
+ Description: 'Check for odd code arrangement in an else block.'
841
+ Enabled: true
842
+
843
+ Lint/EmptyEnsure:
844
+ Description: 'Checks for empty ensure block.'
845
+ Enabled: true
846
+
847
+ Lint/EmptyInterpolation:
848
+ Description: 'Checks for empty string interpolation.'
849
+ Enabled: true
850
+
851
+ Lint/EndAlignment:
852
+ Description: 'Align ends correctly.'
853
+ Enabled: true
854
+
855
+ Lint/EndInMethod:
856
+ Description: 'END blocks should not be placed inside method definitions.'
857
+ Enabled: true
858
+
859
+ Lint/EnsureReturn:
860
+ Description: 'Do not use return in an ensure block.'
861
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-return-ensure'
862
+ Enabled: true
863
+
864
+ Lint/Eval:
865
+ Description: 'The use of eval represents a serious security risk.'
866
+ Enabled: true
867
+
868
+ Lint/HandleExceptions:
869
+ Description: "Don't suppress exception."
870
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions'
871
+ Enabled: true
872
+
873
+ Lint/InvalidCharacterLiteral:
874
+ Description: >-
875
+ Checks for invalid character literals with a non-escaped
876
+ whitespace character.
877
+ Enabled: true
878
+
879
+ Lint/LiteralInCondition:
880
+ Description: 'Checks of literals used in conditions.'
881
+ Enabled: true
882
+
883
+ Lint/LiteralInInterpolation:
884
+ Description: 'Checks for literals used in interpolation.'
885
+ Enabled: true
886
+
887
+ Lint/Loop:
888
+ Description: >-
889
+ Use Kernel#loop with break rather than begin/end/until or
890
+ begin/end/while for post-loop tests.
891
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#loop-with-break'
892
+ Enabled: true
893
+
894
+ Lint/NonLocalExitFromIterator:
895
+ Description: 'Do not use return in iterator to cause non-local exit.'
896
+ Enabled: true
897
+
898
+ Lint/ParenthesesAsGroupedExpression:
899
+ Description: >-
900
+ Checks for method calls with a space before the opening
901
+ parenthesis.
902
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-no-spaces'
903
+ Enabled: true
904
+
905
+ Lint/RequireParentheses:
906
+ Description: >-
907
+ Use parentheses in the method call to avoid confusion
908
+ about precedence.
909
+ Enabled: true
910
+
911
+ Lint/RescueException:
912
+ Description: 'Avoid rescuing the Exception class.'
913
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-blind-rescues'
914
+ Enabled: true
915
+
916
+ Lint/ShadowingOuterLocalVariable:
917
+ Description: >-
918
+ Do not use the same name as outer local variable
919
+ for block arguments or block local variables.
920
+ Enabled: true
921
+
922
+ Lint/SpaceBeforeFirstArg:
923
+ Description: >-
924
+ Put a space between a method name and the first argument
925
+ in a method call without parentheses.
926
+ Enabled: true
927
+
928
+ Lint/StringConversionInInterpolation:
929
+ Description: 'Checks for Object#to_s usage in string interpolation.'
930
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-to-s'
931
+ Enabled: true
932
+
933
+ Lint/UnderscorePrefixedVariableName:
934
+ Description: 'Do not use prefix `_` for a variable that is used.'
935
+ Enabled: true
936
+
937
+ Lint/UnusedBlockArgument:
938
+ Description: 'Checks for unused block arguments.'
939
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars'
940
+ Enabled: true
941
+
942
+ Lint/UnusedMethodArgument:
943
+ Description: 'Checks for unused method arguments.'
944
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars'
945
+ Enabled: true
946
+
947
+ Lint/UnreachableCode:
948
+ Description: 'Unreachable code.'
949
+ Enabled: true
950
+
951
+ Lint/UselessAccessModifier:
952
+ Description: 'Checks for useless access modifiers.'
953
+ Enabled: true
954
+
955
+ Lint/UselessAssignment:
956
+ Description: 'Checks for useless assignment to a local variable.'
957
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars'
958
+ Enabled: true
959
+
960
+ Lint/UselessComparison:
961
+ Description: 'Checks for comparison of something with itself.'
962
+ Enabled: true
963
+
964
+ Lint/UselessElseWithoutRescue:
965
+ Description: 'Checks for useless `else` in `begin..end` without `rescue`.'
966
+ Enabled: true
967
+
968
+ Lint/UselessSetterCall:
969
+ Description: 'Checks for useless setter call to a local variable.'
970
+ Enabled: true
971
+
972
+ Lint/Void:
973
+ Description: 'Possible use of operator/literal/variable in void context.'
974
+ Enabled: true
975
+
976
+ ##################### Performance #############################
977
+
978
+ Performance/Size:
979
+ Description: >-
980
+ Use `size` instead of `count` for counting
981
+ the number of elements in `Array` and `Hash`.
982
+ Enabled: true
983
+
984
+ Performance/Detect:
985
+ Description: >-
986
+ Use `detect` instead of `select.first`, `find_all.first`,
987
+ `select.last`, and `find_all.last`.
988
+ Enabled: true
989
+
990
+ Performance/ReverseEach:
991
+ Description: 'Use `reverse_each` instead of `reverse.each`.'
992
+ Enabled: true
993
+
994
+ Performance/Sample:
995
+ Description: >-
996
+ Use `sample` instead of `shuffle.first`,
997
+ `shuffle.last`, and `shuffle[Fixnum]`.
998
+ Enabled: true
999
+
1000
+ ##################### Rails ##################################
1001
+
1002
+ Rails/ActionFilter:
1003
+ Description: 'Enforces consistent use of action filter methods.'
1004
+ Enabled: true
1005
+
1006
+ Rails/Date:
1007
+ Description: >-
1008
+ Checks the correct usage of date aware methods,
1009
+ such as Date.today, Date.current etc.
1010
+ Enabled: true
1011
+
1012
+ Rails/DefaultScope:
1013
+ Description: 'Checks if the argument passed to default_scope is a block.'
1014
+ Enabled: true
1015
+
1016
+ Rails/Delegate:
1017
+ Description: 'Prefer delegate method for delegations.'
1018
+ Enabled: true
1019
+
1020
+ Rails/HasAndBelongsToMany:
1021
+ Description: 'Prefer has_many :through to has_and_belongs_to_many.'
1022
+ Enabled: true
1023
+
1024
+ Rails/Output:
1025
+ Description: 'Checks for calls to puts, print, etc.'
1026
+ Enabled: true
1027
+
1028
+ Rails/ReadWriteAttribute:
1029
+ Description: >-
1030
+ Checks for read_attribute(:attr) and
1031
+ write_attribute(:attr, val).
1032
+ Enabled: true
1033
+
1034
+ Rails/ScopeArgs:
1035
+ Description: 'Checks the arguments of ActiveRecord scopes.'
1036
+ Enabled: true
1037
+
1038
+ Rails/TimeZone:
1039
+ Description: 'Checks the correct usage of time zone aware methods.'
1040
+ Enabled: true
1041
+
1042
+ Rails/Validation:
1043
+ Description: 'Use validates :attribute, hash of validations.'
1044
+ Enabled: true