rubocop 0.24.1 → 0.25.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of rubocop might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/.rubocop_todo.yml +12 -8
- data/.travis.yml +1 -1
- data/CHANGELOG.md +42 -0
- data/Gemfile +2 -0
- data/README.md +27 -6
- data/bin/rubocop +10 -15
- data/config/default.yml +72 -25
- data/config/enabled.yml +57 -25
- data/lib/rubocop.rb +15 -8
- data/lib/rubocop/config_loader.rb +11 -7
- data/lib/rubocop/cop/cop.rb +16 -16
- data/lib/rubocop/cop/ignored_node.rb +11 -4
- data/lib/rubocop/cop/lint/block_alignment.rb +29 -4
- data/lib/rubocop/cop/lint/debugger.rb +8 -1
- data/lib/rubocop/cop/lint/def_end_alignment.rb +5 -1
- data/lib/rubocop/cop/lint/end_alignment.rb +5 -5
- data/lib/rubocop/cop/lint/end_in_method.rb +2 -2
- data/lib/rubocop/cop/lint/useless_setter_call.rb +2 -2
- data/lib/rubocop/cop/{style → metrics}/block_nesting.rb +1 -1
- data/lib/rubocop/cop/{style → metrics}/class_length.rb +4 -4
- data/lib/rubocop/cop/{style → metrics}/cyclomatic_complexity.rb +5 -16
- data/lib/rubocop/cop/{style → metrics}/line_length.rb +1 -1
- data/lib/rubocop/cop/{style → metrics}/method_length.rb +8 -4
- data/lib/rubocop/cop/{style → metrics}/parameter_lists.rb +1 -1
- data/lib/rubocop/cop/metrics/perceived_complexity.rb +61 -0
- data/lib/rubocop/cop/mixin/autocorrect_unless_changing_ast.rb +10 -2
- data/lib/rubocop/cop/mixin/code_length.rb +2 -3
- data/lib/rubocop/cop/mixin/configurable_naming.rb +6 -20
- data/lib/rubocop/cop/mixin/end_keyword_alignment.rb +1 -1
- data/lib/rubocop/cop/mixin/if_node.rb +1 -1
- data/lib/rubocop/cop/mixin/method_complexity.rb +32 -0
- data/lib/rubocop/cop/mixin/negative_conditional.rb +1 -1
- data/lib/rubocop/cop/mixin/{check_methods.rb → on_method.rb} +3 -3
- data/lib/rubocop/cop/mixin/on_normal_if_unless.rb +24 -0
- data/lib/rubocop/cop/mixin/percent_literal.rb +2 -1
- data/lib/rubocop/cop/mixin/space_inside.rb +33 -4
- data/lib/rubocop/cop/mixin/statement_modifier.rb +14 -14
- data/lib/rubocop/cop/mixin/string_help.rb +4 -0
- data/lib/rubocop/cop/mixin/surrounding_space.rb +1 -0
- data/lib/rubocop/cop/rails/delegate.rb +2 -2
- data/lib/rubocop/cop/rails/output.rb +4 -2
- data/lib/rubocop/cop/style/accessor_method_name.rb +2 -2
- data/lib/rubocop/cop/style/align_hash.rb +9 -1
- data/lib/rubocop/cop/style/and_or.rb +37 -3
- data/lib/rubocop/cop/style/bare_percent_literals.rb +46 -0
- data/lib/rubocop/cop/style/block_end_newline.rb +56 -0
- data/lib/rubocop/cop/style/character_literal.rb +1 -1
- data/lib/rubocop/cop/style/def_with_parentheses.rb +2 -2
- data/lib/rubocop/cop/style/empty_lines_around_access_modifier.rb +31 -3
- data/lib/rubocop/cop/style/empty_lines_around_body.rb +6 -2
- data/lib/rubocop/cop/style/end_of_line.rb +3 -14
- data/lib/rubocop/cop/style/if_unless_modifier.rb +3 -6
- data/lib/rubocop/cop/style/if_with_semicolon.rb +6 -7
- data/lib/rubocop/cop/style/indentation_width.rb +3 -8
- data/lib/rubocop/cop/style/method_def_parentheses.rb +2 -2
- data/lib/rubocop/cop/style/method_name.rb +4 -18
- data/lib/rubocop/cop/style/multiline_block_layout.rb +73 -0
- data/lib/rubocop/cop/style/multiline_if_then.rb +4 -4
- data/lib/rubocop/cop/style/negated_if.rb +1 -1
- data/lib/rubocop/cop/style/negated_while.rb +2 -2
- data/lib/rubocop/cop/style/next.rb +12 -0
- data/lib/rubocop/cop/style/one_line_conditional.rb +6 -6
- data/lib/rubocop/cop/style/percent_literal_delimiters.rb +22 -8
- data/lib/rubocop/cop/style/percent_q_literals.rb +53 -0
- data/lib/rubocop/cop/style/predicate_name.rb +2 -2
- data/lib/rubocop/cop/style/redundant_begin.rb +2 -2
- data/lib/rubocop/cop/style/redundant_return.rb +2 -2
- data/lib/rubocop/cop/style/rescue_modifier.rb +7 -3
- data/lib/rubocop/cop/style/single_line_methods.rb +2 -2
- data/lib/rubocop/cop/style/space_after_method_name.rb +2 -2
- data/lib/rubocop/cop/style/space_inside_block_braces.rb +14 -10
- data/lib/rubocop/cop/style/space_inside_brackets.rb +5 -1
- data/lib/rubocop/cop/style/string_literals.rb +5 -8
- data/lib/rubocop/cop/style/trailing_comma.rb +15 -3
- data/lib/rubocop/cop/style/trivial_accessors.rb +2 -2
- data/lib/rubocop/cop/style/unneeded_capital_w.rb +2 -4
- data/lib/rubocop/cop/style/unneeded_percent_q.rb +13 -0
- data/lib/rubocop/cop/style/variable_interpolation.rb +14 -2
- data/lib/rubocop/cop/style/variable_name.rb +17 -17
- data/lib/rubocop/cop/style/while_until_modifier.rb +2 -5
- data/lib/rubocop/cop/util.rb +5 -0
- data/lib/rubocop/cop/variable_force.rb +7 -6
- data/lib/rubocop/formatter/base_formatter.rb +2 -2
- data/lib/rubocop/processed_source.rb +5 -22
- data/lib/rubocop/version.rb +1 -1
- data/relnotes/v0.25.0.md +91 -0
- data/rubocop.gemspec +2 -3
- data/spec/project_spec.rb +1 -1
- data/spec/rubocop/cli_spec.rb +70 -44
- data/spec/rubocop/comment_config_spec.rb +6 -6
- data/spec/rubocop/config_loader_spec.rb +19 -13
- data/spec/rubocop/config_spec.rb +3 -3
- data/spec/rubocop/cop/commissioner_spec.rb +1 -1
- data/spec/rubocop/cop/cop_spec.rb +3 -3
- data/spec/rubocop/cop/lint/block_alignment_spec.rb +113 -6
- data/spec/rubocop/cop/lint/debugger_spec.rb +10 -6
- data/spec/rubocop/cop/lint/useless_assignment_spec.rb +12 -0
- data/spec/rubocop/cop/{style → metrics}/block_nesting_spec.rb +1 -1
- data/spec/rubocop/cop/{style → metrics}/class_length_spec.rb +1 -1
- data/spec/rubocop/cop/{style → metrics}/cyclomatic_complexity_spec.rb +1 -1
- data/spec/rubocop/cop/{style → metrics}/if_unless_modifier_spec.rb +2 -2
- data/spec/rubocop/cop/{style → metrics}/line_length_spec.rb +7 -7
- data/spec/rubocop/cop/{style → metrics}/method_length_spec.rb +1 -1
- data/spec/rubocop/cop/{style → metrics}/parameter_lists_spec.rb +1 -1
- data/spec/rubocop/cop/metrics/perceived_complexity_spec.rb +222 -0
- data/spec/rubocop/cop/{style → metrics}/while_until_modifier_spec.rb +2 -2
- data/spec/rubocop/cop/rails/output_spec.rb +8 -2
- data/spec/rubocop/cop/style/align_hash_spec.rb +7 -0
- data/spec/rubocop/cop/style/and_or_spec.rb +245 -43
- data/spec/rubocop/cop/style/bare_percent_literals_spec.rb +132 -0
- data/spec/rubocop/cop/style/block_end_newline_spec.rb +61 -0
- data/spec/rubocop/cop/style/empty_lines_around_access_modifier_spec.rb +34 -0
- data/spec/rubocop/cop/style/end_of_line_spec.rb +8 -0
- data/spec/rubocop/cop/style/guard_clause_spec.rb +1 -1
- data/spec/rubocop/cop/style/multiline_block_layout_spec.rb +138 -0
- data/spec/rubocop/cop/style/next_spec.rb +32 -3
- data/spec/rubocop/cop/style/percent_literal_delimiters_spec.rb +34 -0
- data/spec/rubocop/cop/style/percent_q_literals_spec.rb +122 -0
- data/spec/rubocop/cop/style/space_inside_block_braces_spec.rb +20 -0
- data/spec/rubocop/cop/style/space_inside_brackets_spec.rb +26 -2
- data/spec/rubocop/cop/style/trailing_comma_spec.rb +112 -0
- data/spec/rubocop/cop/style/unneeded_percent_q_spec.rb +86 -31
- data/spec/rubocop/cop/style/variable_interpolation_spec.rb +21 -1
- data/spec/rubocop/cop/team_spec.rb +14 -9
- data/spec/spec_helper.rb +1 -0
- metadata +47 -50
- data/lib/rubocop/cop/mixin/if_then_else.rb +0 -23
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubocop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.25.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bozhidar Batsov
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2014-
|
13
|
+
date: 2014-08-15 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rainbow
|
@@ -38,7 +38,7 @@ dependencies:
|
|
38
38
|
requirements:
|
39
39
|
- - ">="
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version: 2.2.0.pre.
|
41
|
+
version: 2.2.0.pre.4
|
42
42
|
- - "<"
|
43
43
|
- !ruby/object:Gem::Version
|
44
44
|
version: '3.0'
|
@@ -48,7 +48,7 @@ dependencies:
|
|
48
48
|
requirements:
|
49
49
|
- - ">="
|
50
50
|
- !ruby/object:Gem::Version
|
51
|
-
version: 2.2.0.pre.
|
51
|
+
version: 2.2.0.pre.4
|
52
52
|
- - "<"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '3.0'
|
@@ -66,26 +66,6 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: 0.0.6
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: json
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - ">="
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: 1.7.7
|
76
|
-
- - "<"
|
77
|
-
- !ruby/object:Gem::Version
|
78
|
-
version: '2'
|
79
|
-
type: :runtime
|
80
|
-
prerelease: false
|
81
|
-
version_requirements: !ruby/object:Gem::Requirement
|
82
|
-
requirements:
|
83
|
-
- - ">="
|
84
|
-
- !ruby/object:Gem::Version
|
85
|
-
version: 1.7.7
|
86
|
-
- - "<"
|
87
|
-
- !ruby/object:Gem::Version
|
88
|
-
version: '2'
|
89
69
|
- !ruby/object:Gem::Dependency
|
90
70
|
name: ruby-progressbar
|
91
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -245,21 +225,29 @@ files:
|
|
245
225
|
- lib/rubocop/cop/lint/useless_else_without_rescue.rb
|
246
226
|
- lib/rubocop/cop/lint/useless_setter_call.rb
|
247
227
|
- lib/rubocop/cop/lint/void.rb
|
228
|
+
- lib/rubocop/cop/metrics/block_nesting.rb
|
229
|
+
- lib/rubocop/cop/metrics/class_length.rb
|
230
|
+
- lib/rubocop/cop/metrics/cyclomatic_complexity.rb
|
231
|
+
- lib/rubocop/cop/metrics/line_length.rb
|
232
|
+
- lib/rubocop/cop/metrics/method_length.rb
|
233
|
+
- lib/rubocop/cop/metrics/parameter_lists.rb
|
234
|
+
- lib/rubocop/cop/metrics/perceived_complexity.rb
|
248
235
|
- lib/rubocop/cop/mixin/access_modifier_node.rb
|
249
236
|
- lib/rubocop/cop/mixin/annotation_comment.rb
|
250
237
|
- lib/rubocop/cop/mixin/array_syntax.rb
|
251
238
|
- lib/rubocop/cop/mixin/autocorrect_alignment.rb
|
252
239
|
- lib/rubocop/cop/mixin/autocorrect_unless_changing_ast.rb
|
253
240
|
- lib/rubocop/cop/mixin/check_assignment.rb
|
254
|
-
- lib/rubocop/cop/mixin/check_methods.rb
|
255
241
|
- lib/rubocop/cop/mixin/code_length.rb
|
256
242
|
- lib/rubocop/cop/mixin/configurable_enforced_style.rb
|
257
243
|
- lib/rubocop/cop/mixin/configurable_max.rb
|
258
244
|
- lib/rubocop/cop/mixin/configurable_naming.rb
|
259
245
|
- lib/rubocop/cop/mixin/end_keyword_alignment.rb
|
260
246
|
- lib/rubocop/cop/mixin/if_node.rb
|
261
|
-
- lib/rubocop/cop/mixin/
|
247
|
+
- lib/rubocop/cop/mixin/method_complexity.rb
|
262
248
|
- lib/rubocop/cop/mixin/negative_conditional.rb
|
249
|
+
- lib/rubocop/cop/mixin/on_method.rb
|
250
|
+
- lib/rubocop/cop/mixin/on_normal_if_unless.rb
|
263
251
|
- lib/rubocop/cop/mixin/parser_diagnostic.rb
|
264
252
|
- lib/rubocop/cop/mixin/percent_literal.rb
|
265
253
|
- lib/rubocop/cop/mixin/safe_assignment.rb
|
@@ -291,9 +279,10 @@ files:
|
|
291
279
|
- lib/rubocop/cop/style/ascii_comments.rb
|
292
280
|
- lib/rubocop/cop/style/ascii_identifiers.rb
|
293
281
|
- lib/rubocop/cop/style/attr.rb
|
282
|
+
- lib/rubocop/cop/style/bare_percent_literals.rb
|
294
283
|
- lib/rubocop/cop/style/begin_block.rb
|
295
284
|
- lib/rubocop/cop/style/block_comments.rb
|
296
|
-
- lib/rubocop/cop/style/
|
285
|
+
- lib/rubocop/cop/style/block_end_newline.rb
|
297
286
|
- lib/rubocop/cop/style/blocks.rb
|
298
287
|
- lib/rubocop/cop/style/braces_around_hash_parameters.rb
|
299
288
|
- lib/rubocop/cop/style/case_equality.rb
|
@@ -302,7 +291,6 @@ files:
|
|
302
291
|
- lib/rubocop/cop/style/class_and_module_camel_case.rb
|
303
292
|
- lib/rubocop/cop/style/class_and_module_children.rb
|
304
293
|
- lib/rubocop/cop/style/class_check.rb
|
305
|
-
- lib/rubocop/cop/style/class_length.rb
|
306
294
|
- lib/rubocop/cop/style/class_methods.rb
|
307
295
|
- lib/rubocop/cop/style/class_vars.rb
|
308
296
|
- lib/rubocop/cop/style/collection_methods.rb
|
@@ -310,7 +298,6 @@ files:
|
|
310
298
|
- lib/rubocop/cop/style/comment_annotation.rb
|
311
299
|
- lib/rubocop/cop/style/comment_indentation.rb
|
312
300
|
- lib/rubocop/cop/style/constant_name.rb
|
313
|
-
- lib/rubocop/cop/style/cyclomatic_complexity.rb
|
314
301
|
- lib/rubocop/cop/style/def_with_parentheses.rb
|
315
302
|
- lib/rubocop/cop/style/deprecated_hash_methods.rb
|
316
303
|
- lib/rubocop/cop/style/documentation.rb
|
@@ -344,14 +331,13 @@ files:
|
|
344
331
|
- lib/rubocop/cop/style/lambda_call.rb
|
345
332
|
- lib/rubocop/cop/style/leading_comment_space.rb
|
346
333
|
- lib/rubocop/cop/style/line_end_concatenation.rb
|
347
|
-
- lib/rubocop/cop/style/line_length.rb
|
348
334
|
- lib/rubocop/cop/style/method_call_parentheses.rb
|
349
335
|
- lib/rubocop/cop/style/method_called_on_do_end_block.rb
|
350
336
|
- lib/rubocop/cop/style/method_def_parentheses.rb
|
351
|
-
- lib/rubocop/cop/style/method_length.rb
|
352
337
|
- lib/rubocop/cop/style/method_name.rb
|
353
338
|
- lib/rubocop/cop/style/module_function.rb
|
354
339
|
- lib/rubocop/cop/style/multiline_block_chain.rb
|
340
|
+
- lib/rubocop/cop/style/multiline_block_layout.rb
|
355
341
|
- lib/rubocop/cop/style/multiline_if_then.rb
|
356
342
|
- lib/rubocop/cop/style/multiline_ternary_operator.rb
|
357
343
|
- lib/rubocop/cop/style/negated_if.rb
|
@@ -364,9 +350,9 @@ files:
|
|
364
350
|
- lib/rubocop/cop/style/numeric_literals.rb
|
365
351
|
- lib/rubocop/cop/style/one_line_conditional.rb
|
366
352
|
- lib/rubocop/cop/style/op_method.rb
|
367
|
-
- lib/rubocop/cop/style/parameter_lists.rb
|
368
353
|
- lib/rubocop/cop/style/parentheses_around_condition.rb
|
369
354
|
- lib/rubocop/cop/style/percent_literal_delimiters.rb
|
355
|
+
- lib/rubocop/cop/style/percent_q_literals.rb
|
370
356
|
- lib/rubocop/cop/style/perl_backrefs.rb
|
371
357
|
- lib/rubocop/cop/style/predicate_name.rb
|
372
358
|
- lib/rubocop/cop/style/proc.rb
|
@@ -457,6 +443,7 @@ files:
|
|
457
443
|
- relnotes/v0.23.0.md
|
458
444
|
- relnotes/v0.24.0.md
|
459
445
|
- relnotes/v0.24.1.md
|
446
|
+
- relnotes/v0.25.0.md
|
460
447
|
- rubocop.gemspec
|
461
448
|
- spec/.rubocop.yml
|
462
449
|
- spec/isolated_environment_spec.rb
|
@@ -507,6 +494,15 @@ files:
|
|
507
494
|
- spec/rubocop/cop/lint/useless_else_without_rescue_spec.rb
|
508
495
|
- spec/rubocop/cop/lint/useless_setter_call_spec.rb
|
509
496
|
- spec/rubocop/cop/lint/void_spec.rb
|
497
|
+
- spec/rubocop/cop/metrics/block_nesting_spec.rb
|
498
|
+
- spec/rubocop/cop/metrics/class_length_spec.rb
|
499
|
+
- spec/rubocop/cop/metrics/cyclomatic_complexity_spec.rb
|
500
|
+
- spec/rubocop/cop/metrics/if_unless_modifier_spec.rb
|
501
|
+
- spec/rubocop/cop/metrics/line_length_spec.rb
|
502
|
+
- spec/rubocop/cop/metrics/method_length_spec.rb
|
503
|
+
- spec/rubocop/cop/metrics/parameter_lists_spec.rb
|
504
|
+
- spec/rubocop/cop/metrics/perceived_complexity_spec.rb
|
505
|
+
- spec/rubocop/cop/metrics/while_until_modifier_spec.rb
|
510
506
|
- spec/rubocop/cop/offense_spec.rb
|
511
507
|
- spec/rubocop/cop/rails/action_filter_spec.rb
|
512
508
|
- spec/rubocop/cop/rails/default_scope_spec.rb
|
@@ -528,9 +524,10 @@ files:
|
|
528
524
|
- spec/rubocop/cop/style/ascii_comments_spec.rb
|
529
525
|
- spec/rubocop/cop/style/ascii_identifiers_spec.rb
|
530
526
|
- spec/rubocop/cop/style/attr_spec.rb
|
527
|
+
- spec/rubocop/cop/style/bare_percent_literals_spec.rb
|
531
528
|
- spec/rubocop/cop/style/begin_block_spec.rb
|
532
529
|
- spec/rubocop/cop/style/block_comments_spec.rb
|
533
|
-
- spec/rubocop/cop/style/
|
530
|
+
- spec/rubocop/cop/style/block_end_newline_spec.rb
|
534
531
|
- spec/rubocop/cop/style/blocks_spec.rb
|
535
532
|
- spec/rubocop/cop/style/braces_around_hash_parameters_spec.rb
|
536
533
|
- spec/rubocop/cop/style/case_equality_spec.rb
|
@@ -539,7 +536,6 @@ files:
|
|
539
536
|
- spec/rubocop/cop/style/class_and_module_camel_case_spec.rb
|
540
537
|
- spec/rubocop/cop/style/class_and_module_children_spec.rb
|
541
538
|
- spec/rubocop/cop/style/class_check_spec.rb
|
542
|
-
- spec/rubocop/cop/style/class_length_spec.rb
|
543
539
|
- spec/rubocop/cop/style/class_methods_spec.rb
|
544
540
|
- spec/rubocop/cop/style/class_vars_spec.rb
|
545
541
|
- spec/rubocop/cop/style/collection_methods_spec.rb
|
@@ -547,7 +543,6 @@ files:
|
|
547
543
|
- spec/rubocop/cop/style/comment_annotation_spec.rb
|
548
544
|
- spec/rubocop/cop/style/comment_indentation_spec.rb
|
549
545
|
- spec/rubocop/cop/style/constant_name_spec.rb
|
550
|
-
- spec/rubocop/cop/style/cyclomatic_complexity_spec.rb
|
551
546
|
- spec/rubocop/cop/style/def_with_parentheses_spec.rb
|
552
547
|
- spec/rubocop/cop/style/deprecated_hash_methods_spec.rb
|
553
548
|
- spec/rubocop/cop/style/documentation_spec.rb
|
@@ -570,7 +565,6 @@ files:
|
|
570
565
|
- spec/rubocop/cop/style/global_vars_spec.rb
|
571
566
|
- spec/rubocop/cop/style/guard_clause_spec.rb
|
572
567
|
- spec/rubocop/cop/style/hash_syntax_spec.rb
|
573
|
-
- spec/rubocop/cop/style/if_unless_modifier_spec.rb
|
574
568
|
- spec/rubocop/cop/style/if_with_semicolon_spec.rb
|
575
569
|
- spec/rubocop/cop/style/indent_array_spec.rb
|
576
570
|
- spec/rubocop/cop/style/indent_hash_spec.rb
|
@@ -581,14 +575,13 @@ files:
|
|
581
575
|
- spec/rubocop/cop/style/lambda_spec.rb
|
582
576
|
- spec/rubocop/cop/style/leading_comment_space_spec.rb
|
583
577
|
- spec/rubocop/cop/style/line_end_concatenation_spec.rb
|
584
|
-
- spec/rubocop/cop/style/line_length_spec.rb
|
585
578
|
- spec/rubocop/cop/style/method_call_parentheses_spec.rb
|
586
579
|
- spec/rubocop/cop/style/method_called_on_do_end_block_spec.rb
|
587
580
|
- spec/rubocop/cop/style/method_def_parentheses_spec.rb
|
588
|
-
- spec/rubocop/cop/style/method_length_spec.rb
|
589
581
|
- spec/rubocop/cop/style/method_name_spec.rb
|
590
582
|
- spec/rubocop/cop/style/module_function_spec.rb
|
591
583
|
- spec/rubocop/cop/style/multiline_block_chain_spec.rb
|
584
|
+
- spec/rubocop/cop/style/multiline_block_layout_spec.rb
|
592
585
|
- spec/rubocop/cop/style/multiline_if_then_spec.rb
|
593
586
|
- spec/rubocop/cop/style/multiline_ternary_operator_spec.rb
|
594
587
|
- spec/rubocop/cop/style/negated_if_spec.rb
|
@@ -601,9 +594,9 @@ files:
|
|
601
594
|
- spec/rubocop/cop/style/numeric_literals_spec.rb
|
602
595
|
- spec/rubocop/cop/style/one_line_conditional_spec.rb
|
603
596
|
- spec/rubocop/cop/style/op_method_spec.rb
|
604
|
-
- spec/rubocop/cop/style/parameter_lists_spec.rb
|
605
597
|
- spec/rubocop/cop/style/parentheses_around_condition_spec.rb
|
606
598
|
- spec/rubocop/cop/style/percent_literal_delimiters_spec.rb
|
599
|
+
- spec/rubocop/cop/style/percent_q_literals_spec.rb
|
607
600
|
- spec/rubocop/cop/style/perl_backrefs_spec.rb
|
608
601
|
- spec/rubocop/cop/style/predicate_name_spec.rb
|
609
602
|
- spec/rubocop/cop/style/proc_spec.rb
|
@@ -653,7 +646,6 @@ files:
|
|
653
646
|
- spec/rubocop/cop/style/variable_name_spec.rb
|
654
647
|
- spec/rubocop/cop/style/when_then_spec.rb
|
655
648
|
- spec/rubocop/cop/style/while_until_do_spec.rb
|
656
|
-
- spec/rubocop/cop/style/while_until_modifier_spec.rb
|
657
649
|
- spec/rubocop/cop/style/word_array_spec.rb
|
658
650
|
- spec/rubocop/cop/team_spec.rb
|
659
651
|
- spec/rubocop/cop/util_spec.rb
|
@@ -703,7 +695,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
703
695
|
requirements:
|
704
696
|
- - ">="
|
705
697
|
- !ruby/object:Gem::Version
|
706
|
-
version: 1.9.
|
698
|
+
version: 1.9.3
|
707
699
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
708
700
|
requirements:
|
709
701
|
- - ">="
|
@@ -711,7 +703,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
711
703
|
version: '0'
|
712
704
|
requirements: []
|
713
705
|
rubyforge_project:
|
714
|
-
rubygems_version: 2.
|
706
|
+
rubygems_version: 2.2.2
|
715
707
|
signing_key:
|
716
708
|
specification_version: 4
|
717
709
|
summary: Automatic Ruby code style checking tool.
|
@@ -765,6 +757,15 @@ test_files:
|
|
765
757
|
- spec/rubocop/cop/lint/useless_else_without_rescue_spec.rb
|
766
758
|
- spec/rubocop/cop/lint/useless_setter_call_spec.rb
|
767
759
|
- spec/rubocop/cop/lint/void_spec.rb
|
760
|
+
- spec/rubocop/cop/metrics/block_nesting_spec.rb
|
761
|
+
- spec/rubocop/cop/metrics/class_length_spec.rb
|
762
|
+
- spec/rubocop/cop/metrics/cyclomatic_complexity_spec.rb
|
763
|
+
- spec/rubocop/cop/metrics/if_unless_modifier_spec.rb
|
764
|
+
- spec/rubocop/cop/metrics/line_length_spec.rb
|
765
|
+
- spec/rubocop/cop/metrics/method_length_spec.rb
|
766
|
+
- spec/rubocop/cop/metrics/parameter_lists_spec.rb
|
767
|
+
- spec/rubocop/cop/metrics/perceived_complexity_spec.rb
|
768
|
+
- spec/rubocop/cop/metrics/while_until_modifier_spec.rb
|
768
769
|
- spec/rubocop/cop/offense_spec.rb
|
769
770
|
- spec/rubocop/cop/rails/action_filter_spec.rb
|
770
771
|
- spec/rubocop/cop/rails/default_scope_spec.rb
|
@@ -786,9 +787,10 @@ test_files:
|
|
786
787
|
- spec/rubocop/cop/style/ascii_comments_spec.rb
|
787
788
|
- spec/rubocop/cop/style/ascii_identifiers_spec.rb
|
788
789
|
- spec/rubocop/cop/style/attr_spec.rb
|
790
|
+
- spec/rubocop/cop/style/bare_percent_literals_spec.rb
|
789
791
|
- spec/rubocop/cop/style/begin_block_spec.rb
|
790
792
|
- spec/rubocop/cop/style/block_comments_spec.rb
|
791
|
-
- spec/rubocop/cop/style/
|
793
|
+
- spec/rubocop/cop/style/block_end_newline_spec.rb
|
792
794
|
- spec/rubocop/cop/style/blocks_spec.rb
|
793
795
|
- spec/rubocop/cop/style/braces_around_hash_parameters_spec.rb
|
794
796
|
- spec/rubocop/cop/style/case_equality_spec.rb
|
@@ -797,7 +799,6 @@ test_files:
|
|
797
799
|
- spec/rubocop/cop/style/class_and_module_camel_case_spec.rb
|
798
800
|
- spec/rubocop/cop/style/class_and_module_children_spec.rb
|
799
801
|
- spec/rubocop/cop/style/class_check_spec.rb
|
800
|
-
- spec/rubocop/cop/style/class_length_spec.rb
|
801
802
|
- spec/rubocop/cop/style/class_methods_spec.rb
|
802
803
|
- spec/rubocop/cop/style/class_vars_spec.rb
|
803
804
|
- spec/rubocop/cop/style/collection_methods_spec.rb
|
@@ -805,7 +806,6 @@ test_files:
|
|
805
806
|
- spec/rubocop/cop/style/comment_annotation_spec.rb
|
806
807
|
- spec/rubocop/cop/style/comment_indentation_spec.rb
|
807
808
|
- spec/rubocop/cop/style/constant_name_spec.rb
|
808
|
-
- spec/rubocop/cop/style/cyclomatic_complexity_spec.rb
|
809
809
|
- spec/rubocop/cop/style/def_with_parentheses_spec.rb
|
810
810
|
- spec/rubocop/cop/style/deprecated_hash_methods_spec.rb
|
811
811
|
- spec/rubocop/cop/style/documentation_spec.rb
|
@@ -828,7 +828,6 @@ test_files:
|
|
828
828
|
- spec/rubocop/cop/style/global_vars_spec.rb
|
829
829
|
- spec/rubocop/cop/style/guard_clause_spec.rb
|
830
830
|
- spec/rubocop/cop/style/hash_syntax_spec.rb
|
831
|
-
- spec/rubocop/cop/style/if_unless_modifier_spec.rb
|
832
831
|
- spec/rubocop/cop/style/if_with_semicolon_spec.rb
|
833
832
|
- spec/rubocop/cop/style/indent_array_spec.rb
|
834
833
|
- spec/rubocop/cop/style/indent_hash_spec.rb
|
@@ -839,14 +838,13 @@ test_files:
|
|
839
838
|
- spec/rubocop/cop/style/lambda_spec.rb
|
840
839
|
- spec/rubocop/cop/style/leading_comment_space_spec.rb
|
841
840
|
- spec/rubocop/cop/style/line_end_concatenation_spec.rb
|
842
|
-
- spec/rubocop/cop/style/line_length_spec.rb
|
843
841
|
- spec/rubocop/cop/style/method_call_parentheses_spec.rb
|
844
842
|
- spec/rubocop/cop/style/method_called_on_do_end_block_spec.rb
|
845
843
|
- spec/rubocop/cop/style/method_def_parentheses_spec.rb
|
846
|
-
- spec/rubocop/cop/style/method_length_spec.rb
|
847
844
|
- spec/rubocop/cop/style/method_name_spec.rb
|
848
845
|
- spec/rubocop/cop/style/module_function_spec.rb
|
849
846
|
- spec/rubocop/cop/style/multiline_block_chain_spec.rb
|
847
|
+
- spec/rubocop/cop/style/multiline_block_layout_spec.rb
|
850
848
|
- spec/rubocop/cop/style/multiline_if_then_spec.rb
|
851
849
|
- spec/rubocop/cop/style/multiline_ternary_operator_spec.rb
|
852
850
|
- spec/rubocop/cop/style/negated_if_spec.rb
|
@@ -859,9 +857,9 @@ test_files:
|
|
859
857
|
- spec/rubocop/cop/style/numeric_literals_spec.rb
|
860
858
|
- spec/rubocop/cop/style/one_line_conditional_spec.rb
|
861
859
|
- spec/rubocop/cop/style/op_method_spec.rb
|
862
|
-
- spec/rubocop/cop/style/parameter_lists_spec.rb
|
863
860
|
- spec/rubocop/cop/style/parentheses_around_condition_spec.rb
|
864
861
|
- spec/rubocop/cop/style/percent_literal_delimiters_spec.rb
|
862
|
+
- spec/rubocop/cop/style/percent_q_literals_spec.rb
|
865
863
|
- spec/rubocop/cop/style/perl_backrefs_spec.rb
|
866
864
|
- spec/rubocop/cop/style/predicate_name_spec.rb
|
867
865
|
- spec/rubocop/cop/style/proc_spec.rb
|
@@ -911,7 +909,6 @@ test_files:
|
|
911
909
|
- spec/rubocop/cop/style/variable_name_spec.rb
|
912
910
|
- spec/rubocop/cop/style/when_then_spec.rb
|
913
911
|
- spec/rubocop/cop/style/while_until_do_spec.rb
|
914
|
-
- spec/rubocop/cop/style/while_until_modifier_spec.rb
|
915
912
|
- spec/rubocop/cop/style/word_array_spec.rb
|
916
913
|
- spec/rubocop/cop/team_spec.rb
|
917
914
|
- spec/rubocop/cop/util_spec.rb
|
@@ -1,23 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
module RuboCop
|
4
|
-
module Cop
|
5
|
-
# Common functionality for cops checking if and unless statements.
|
6
|
-
module IfThenElse
|
7
|
-
def on_if(node)
|
8
|
-
check(node)
|
9
|
-
end
|
10
|
-
|
11
|
-
def on_unless(node)
|
12
|
-
check(node)
|
13
|
-
end
|
14
|
-
|
15
|
-
def check(node)
|
16
|
-
# We won't check modifier or ternary conditionals.
|
17
|
-
return unless node.loc.expression.source =~ /\A(if|unless)\b/
|
18
|
-
return unless offending_line(node)
|
19
|
-
add_offense(node, :expression, error_message(node))
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|