rubocop 0.34.2 → 0.35.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.

Potentially problematic release.


This version of rubocop might be problematic. Click here for more details.

Files changed (102) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +86 -0
  3. data/README.md +103 -31
  4. data/config/default.yml +32 -2
  5. data/config/disabled.yml +24 -0
  6. data/config/enabled.yml +20 -2
  7. data/lib/rubocop.rb +13 -0
  8. data/lib/rubocop/ast_node.rb +48 -0
  9. data/lib/rubocop/cli.rb +9 -0
  10. data/lib/rubocop/config.rb +8 -6
  11. data/lib/rubocop/config_loader.rb +30 -8
  12. data/lib/rubocop/cop/commissioner.rb +1 -1
  13. data/lib/rubocop/cop/cop.rb +19 -6
  14. data/lib/rubocop/cop/lint/circular_argument_reference.rb +33 -2
  15. data/lib/rubocop/cop/lint/debugger.rb +9 -56
  16. data/lib/rubocop/cop/lint/end_alignment.rb +29 -9
  17. data/lib/rubocop/cop/lint/eval.rb +6 -2
  18. data/lib/rubocop/cop/lint/format_parameter_mismatch.rb +24 -6
  19. data/lib/rubocop/cop/lint/literal_in_condition.rb +0 -5
  20. data/lib/rubocop/cop/lint/non_local_exit_from_iterator.rb +10 -1
  21. data/lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb +1 -1
  22. data/lib/rubocop/cop/lint/space_before_first_arg.rb +1 -1
  23. data/lib/rubocop/cop/lint/unused_block_argument.rb +6 -0
  24. data/lib/rubocop/cop/lint/unused_method_argument.rb +8 -0
  25. data/lib/rubocop/cop/metrics/abc_size.rb +1 -1
  26. data/lib/rubocop/cop/mixin/access_modifier_node.rb +1 -1
  27. data/lib/rubocop/cop/mixin/autocorrect_alignment.rb +1 -1
  28. data/lib/rubocop/cop/mixin/autocorrect_unless_changing_ast.rb +26 -3
  29. data/lib/rubocop/cop/mixin/check_assignment.rb +2 -3
  30. data/lib/rubocop/cop/mixin/configurable_enforced_style.rb +59 -12
  31. data/lib/rubocop/cop/mixin/configurable_max.rb +1 -1
  32. data/lib/rubocop/cop/mixin/configurable_naming.rb +1 -1
  33. data/lib/rubocop/cop/mixin/first_element_line_break.rb +41 -0
  34. data/lib/rubocop/cop/mixin/negative_conditional.rb +1 -1
  35. data/lib/rubocop/cop/mixin/safe_assignment.rb +3 -14
  36. data/lib/rubocop/cop/mixin/statement_modifier.rb +2 -2
  37. data/lib/rubocop/cop/performance/detect.rb +5 -1
  38. data/lib/rubocop/cop/performance/fixed_size.rb +50 -0
  39. data/lib/rubocop/cop/performance/size.rb +1 -1
  40. data/lib/rubocop/cop/performance/string_replacement.rb +14 -8
  41. data/lib/rubocop/cop/rails/pluralization_grammar.rb +97 -0
  42. data/lib/rubocop/cop/style/align_hash.rb +1 -12
  43. data/lib/rubocop/cop/style/align_parameters.rb +19 -7
  44. data/lib/rubocop/cop/style/and_or.rb +42 -13
  45. data/lib/rubocop/cop/style/block_comments.rb +4 -2
  46. data/lib/rubocop/cop/style/block_delimiters.rb +57 -18
  47. data/lib/rubocop/cop/style/braces_around_hash_parameters.rb +1 -1
  48. data/lib/rubocop/cop/style/command_literal.rb +2 -10
  49. data/lib/rubocop/cop/style/copyright.rb +5 -3
  50. data/lib/rubocop/cop/style/documentation.rb +9 -6
  51. data/lib/rubocop/cop/style/dot_position.rb +6 -0
  52. data/lib/rubocop/cop/style/double_negation.rb +4 -15
  53. data/lib/rubocop/cop/style/each_with_object.rb +17 -4
  54. data/lib/rubocop/cop/style/empty_line_between_defs.rb +1 -5
  55. data/lib/rubocop/cop/style/encoding.rb +10 -4
  56. data/lib/rubocop/cop/style/extra_spacing.rb +23 -13
  57. data/lib/rubocop/cop/style/first_array_element_line_break.rb +41 -0
  58. data/lib/rubocop/cop/style/first_hash_element_line_break.rb +35 -0
  59. data/lib/rubocop/cop/style/first_method_argument_line_break.rb +37 -0
  60. data/lib/rubocop/cop/style/first_method_parameter_line_break.rb +42 -0
  61. data/lib/rubocop/cop/style/for.rb +2 -1
  62. data/lib/rubocop/cop/style/if_unless_modifier.rb +31 -0
  63. data/lib/rubocop/cop/style/indent_hash.rb +67 -37
  64. data/lib/rubocop/cop/style/indentation_width.rb +1 -1
  65. data/lib/rubocop/cop/style/leading_comment_space.rb +3 -2
  66. data/lib/rubocop/cop/style/method_call_parentheses.rb +8 -0
  67. data/lib/rubocop/cop/style/method_def_parentheses.rb +10 -7
  68. data/lib/rubocop/cop/style/multiline_operation_indentation.rb +8 -13
  69. data/lib/rubocop/cop/style/nested_modifier.rb +97 -0
  70. data/lib/rubocop/cop/style/next.rb +18 -0
  71. data/lib/rubocop/cop/style/parallel_assignment.rb +57 -15
  72. data/lib/rubocop/cop/style/predicate_name.rb +7 -2
  73. data/lib/rubocop/cop/style/regexp_literal.rb +2 -10
  74. data/lib/rubocop/cop/style/single_line_methods.rb +7 -5
  75. data/lib/rubocop/cop/style/single_space_before_first_arg.rb +1 -1
  76. data/lib/rubocop/cop/style/space_around_operators.rb +2 -0
  77. data/lib/rubocop/cop/style/special_global_vars.rb +4 -2
  78. data/lib/rubocop/cop/style/stabby_lambda_parentheses.rb +108 -0
  79. data/lib/rubocop/cop/style/trailing_comma.rb +9 -6
  80. data/lib/rubocop/cop/style/trailing_underscore_variable.rb +23 -2
  81. data/lib/rubocop/cop/style/unneeded_percent_q.rb +31 -20
  82. data/lib/rubocop/cop/style/variable_name.rb +5 -0
  83. data/lib/rubocop/cop/style/word_array.rb +2 -1
  84. data/lib/rubocop/cop/team.rb +17 -4
  85. data/lib/rubocop/cop/util.rb +5 -0
  86. data/lib/rubocop/cop/variable_force/locatable.rb +1 -1
  87. data/lib/rubocop/formatter/base_formatter.rb +1 -1
  88. data/lib/rubocop/formatter/disabled_config_formatter.rb +22 -10
  89. data/lib/rubocop/formatter/simple_text_formatter.rb +1 -1
  90. data/lib/rubocop/node_pattern.rb +390 -0
  91. data/lib/rubocop/options.rb +48 -36
  92. data/lib/rubocop/processed_source.rb +3 -1
  93. data/lib/rubocop/rake_task.rb +1 -1
  94. data/lib/rubocop/remote_config.rb +60 -0
  95. data/lib/rubocop/result_cache.rb +4 -2
  96. data/lib/rubocop/runner.rb +33 -10
  97. data/lib/rubocop/token.rb +2 -1
  98. data/lib/rubocop/version.rb +1 -1
  99. data/lib/rubocop/warning.rb +11 -0
  100. data/relnotes/v0.35.0.md +210 -0
  101. data/rubocop.gemspec +2 -2
  102. metadata +20 -6
@@ -39,10 +39,10 @@ Gem::Specification.new do |s|
39
39
  s.summary = 'Automatic Ruby code style checking tool.'
40
40
 
41
41
  s.add_runtime_dependency('rainbow', '>= 1.99.1', '< 3.0')
42
- s.add_runtime_dependency('parser', '>= 2.2.2.5', '< 3.0')
42
+ s.add_runtime_dependency('parser', '>= 2.2.3.0', '< 3.0')
43
43
  s.add_runtime_dependency('powerpack', '~> 0.1')
44
44
  s.add_runtime_dependency('astrolabe', '~> 1.3')
45
- s.add_runtime_dependency('ruby-progressbar', '~> 1.4')
45
+ s.add_runtime_dependency('ruby-progressbar', '~> 1.7')
46
46
  s.add_development_dependency('rake', '~> 10.1')
47
47
  s.add_development_dependency('rspec', '~> 3.3.0')
48
48
  s.add_development_dependency('yard', '~> 0.8')
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.34.2
4
+ version: 0.35.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: 2015-09-21 00:00:00.000000000 Z
13
+ date: 2015-11-07 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.2.5
41
+ version: 2.2.3.0
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.2.5
51
+ version: 2.2.3.0
52
52
  - - "<"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '3.0'
@@ -86,14 +86,14 @@ dependencies:
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '1.4'
89
+ version: '1.7'
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '1.4'
96
+ version: '1.7'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: rake
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -187,6 +187,7 @@ files:
187
187
  - config/disabled.yml
188
188
  - config/enabled.yml
189
189
  - lib/rubocop.rb
190
+ - lib/rubocop/ast_node.rb
190
191
  - lib/rubocop/cli.rb
191
192
  - lib/rubocop/comment_config.rb
192
193
  - lib/rubocop/config.rb
@@ -265,6 +266,7 @@ files:
265
266
  - lib/rubocop/cop/mixin/configurable_naming.rb
266
267
  - lib/rubocop/cop/mixin/empty_lines_around_body.rb
267
268
  - lib/rubocop/cop/mixin/end_keyword_alignment.rb
269
+ - lib/rubocop/cop/mixin/first_element_line_break.rb
268
270
  - lib/rubocop/cop/mixin/if_node.rb
269
271
  - lib/rubocop/cop/mixin/method_complexity.rb
270
272
  - lib/rubocop/cop/mixin/method_preference.rb
@@ -287,6 +289,7 @@ files:
287
289
  - lib/rubocop/cop/performance/case_when_splat.rb
288
290
  - lib/rubocop/cop/performance/count.rb
289
291
  - lib/rubocop/cop/performance/detect.rb
292
+ - lib/rubocop/cop/performance/fixed_size.rb
290
293
  - lib/rubocop/cop/performance/flat_map.rb
291
294
  - lib/rubocop/cop/performance/reverse_each.rb
292
295
  - lib/rubocop/cop/performance/sample.rb
@@ -300,6 +303,7 @@ files:
300
303
  - lib/rubocop/cop/rails/find_each.rb
301
304
  - lib/rubocop/cop/rails/has_and_belongs_to_many.rb
302
305
  - lib/rubocop/cop/rails/output.rb
306
+ - lib/rubocop/cop/rails/pluralization_grammar.rb
303
307
  - lib/rubocop/cop/rails/read_write_attribute.rb
304
308
  - lib/rubocop/cop/rails/scope_args.rb
305
309
  - lib/rubocop/cop/rails/time_zone.rb
@@ -361,6 +365,10 @@ files:
361
365
  - lib/rubocop/cop/style/even_odd.rb
362
366
  - lib/rubocop/cop/style/extra_spacing.rb
363
367
  - lib/rubocop/cop/style/file_name.rb
368
+ - lib/rubocop/cop/style/first_array_element_line_break.rb
369
+ - lib/rubocop/cop/style/first_hash_element_line_break.rb
370
+ - lib/rubocop/cop/style/first_method_argument_line_break.rb
371
+ - lib/rubocop/cop/style/first_method_parameter_line_break.rb
364
372
  - lib/rubocop/cop/style/first_parameter_indentation.rb
365
373
  - lib/rubocop/cop/style/flip_flop.rb
366
374
  - lib/rubocop/cop/style/for.rb
@@ -395,6 +403,7 @@ files:
395
403
  - lib/rubocop/cop/style/mutable_constant.rb
396
404
  - lib/rubocop/cop/style/negated_if.rb
397
405
  - lib/rubocop/cop/style/negated_while.rb
406
+ - lib/rubocop/cop/style/nested_modifier.rb
398
407
  - lib/rubocop/cop/style/nested_ternary_operator.rb
399
408
  - lib/rubocop/cop/style/next.rb
400
409
  - lib/rubocop/cop/style/nil_comparison.rb
@@ -449,6 +458,7 @@ files:
449
458
  - lib/rubocop/cop/style/space_inside_range_literal.rb
450
459
  - lib/rubocop/cop/style/space_inside_string_interpolation.rb
451
460
  - lib/rubocop/cop/style/special_global_vars.rb
461
+ - lib/rubocop/cop/style/stabby_lambda_parentheses.rb
452
462
  - lib/rubocop/cop/style/string_literals.rb
453
463
  - lib/rubocop/cop/style/string_literals_in_interpolation.rb
454
464
  - lib/rubocop/cop/style/string_methods.rb
@@ -495,16 +505,19 @@ files:
495
505
  - lib/rubocop/formatter/progress_formatter.rb
496
506
  - lib/rubocop/formatter/simple_text_formatter.rb
497
507
  - lib/rubocop/formatter/text_util.rb
508
+ - lib/rubocop/node_pattern.rb
498
509
  - lib/rubocop/options.rb
499
510
  - lib/rubocop/path_util.rb
500
511
  - lib/rubocop/processed_source.rb
501
512
  - lib/rubocop/rake_task.rb
513
+ - lib/rubocop/remote_config.rb
502
514
  - lib/rubocop/result_cache.rb
503
515
  - lib/rubocop/runner.rb
504
516
  - lib/rubocop/string_util.rb
505
517
  - lib/rubocop/target_finder.rb
506
518
  - lib/rubocop/token.rb
507
519
  - lib/rubocop/version.rb
520
+ - lib/rubocop/warning.rb
508
521
  - logo/rubo-logo-horizontal.png
509
522
  - logo/rubo-logo-square.png
510
523
  - logo/rubo-logo-symbol.png
@@ -534,6 +547,7 @@ files:
534
547
  - relnotes/v0.34.0.md
535
548
  - relnotes/v0.34.1.md
536
549
  - relnotes/v0.34.2.md
550
+ - relnotes/v0.35.0.md
537
551
  - rubocop.gemspec
538
552
  homepage: http://github.com/bbatsov/rubocop
539
553
  licenses: