rubocop 1.1.0 → 1.4.1

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.
Files changed (98) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +29 -12
  3. data/config/default.yml +113 -16
  4. data/exe/rubocop +1 -1
  5. data/lib/rubocop.rb +9 -0
  6. data/lib/rubocop/cli/command/execute_runner.rb +26 -11
  7. data/lib/rubocop/config_loader.rb +14 -5
  8. data/lib/rubocop/config_regeneration.rb +1 -1
  9. data/lib/rubocop/cop/bundler/duplicated_gem.rb +3 -3
  10. data/lib/rubocop/cop/bundler/gem_comment.rb +1 -1
  11. data/lib/rubocop/cop/commissioner.rb +1 -1
  12. data/lib/rubocop/cop/correctors/percent_literal_corrector.rb +1 -1
  13. data/lib/rubocop/cop/gemspec/duplicated_assignment.rb +3 -3
  14. data/lib/rubocop/cop/gemspec/required_ruby_version.rb +4 -5
  15. data/lib/rubocop/cop/gemspec/ruby_version_globals_usage.rb +1 -1
  16. data/lib/rubocop/cop/generator.rb +2 -9
  17. data/lib/rubocop/cop/generator/configuration_injector.rb +1 -1
  18. data/lib/rubocop/cop/internal_affairs/useless_message_assertion.rb +1 -1
  19. data/lib/rubocop/cop/layout/block_alignment.rb +3 -4
  20. data/lib/rubocop/cop/layout/class_structure.rb +15 -3
  21. data/lib/rubocop/cop/layout/else_alignment.rb +15 -2
  22. data/lib/rubocop/cop/layout/empty_line_between_defs.rb +77 -7
  23. data/lib/rubocop/cop/layout/end_alignment.rb +3 -3
  24. data/lib/rubocop/cop/layout/hash_alignment.rb +4 -4
  25. data/lib/rubocop/cop/layout/line_length.rb +8 -1
  26. data/lib/rubocop/cop/layout/space_around_block_parameters.rb +24 -18
  27. data/lib/rubocop/cop/layout/space_around_method_call_operator.rb +1 -1
  28. data/lib/rubocop/cop/layout/space_inside_parens.rb +35 -13
  29. data/lib/rubocop/cop/lint/ambiguous_regexp_literal.rb +2 -1
  30. data/lib/rubocop/cop/lint/constant_definition_in_block.rb +26 -2
  31. data/lib/rubocop/cop/lint/debugger.rb +17 -27
  32. data/lib/rubocop/cop/lint/duplicate_branch.rb +93 -0
  33. data/lib/rubocop/cop/lint/duplicate_case_condition.rb +2 -12
  34. data/lib/rubocop/cop/lint/else_layout.rb +29 -3
  35. data/lib/rubocop/cop/lint/empty_block.rb +38 -2
  36. data/lib/rubocop/cop/lint/empty_class.rb +93 -0
  37. data/lib/rubocop/cop/lint/literal_in_interpolation.rb +22 -4
  38. data/lib/rubocop/cop/lint/loop.rb +4 -4
  39. data/lib/rubocop/cop/lint/missing_super.rb +7 -4
  40. data/lib/rubocop/cop/lint/nested_percent_literal.rb +14 -0
  41. data/lib/rubocop/cop/lint/no_return_in_begin_end_blocks.rb +58 -0
  42. data/lib/rubocop/cop/lint/redundant_cop_enable_directive.rb +19 -16
  43. data/lib/rubocop/cop/lint/shadowed_exception.rb +4 -5
  44. data/lib/rubocop/cop/lint/to_enum_arguments.rb +6 -15
  45. data/lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb +13 -4
  46. data/lib/rubocop/cop/lint/useless_method_definition.rb +2 -4
  47. data/lib/rubocop/cop/lint/useless_setter_call.rb +6 -1
  48. data/lib/rubocop/cop/metrics/method_length.rb +1 -1
  49. data/lib/rubocop/cop/mixin/check_line_breakable.rb +1 -1
  50. data/lib/rubocop/cop/mixin/configurable_numbering.rb +3 -3
  51. data/lib/rubocop/cop/mixin/multiline_expression_indentation.rb +1 -1
  52. data/lib/rubocop/cop/mixin/statement_modifier.rb +9 -4
  53. data/lib/rubocop/cop/mixin/visibility_help.rb +1 -3
  54. data/lib/rubocop/cop/naming/binary_operator_parameter_name.rb +11 -1
  55. data/lib/rubocop/cop/naming/heredoc_delimiter_case.rb +11 -5
  56. data/lib/rubocop/cop/naming/memoized_instance_variable_name.rb +67 -18
  57. data/lib/rubocop/cop/naming/variable_number.rb +98 -8
  58. data/lib/rubocop/cop/style/and_or.rb +1 -3
  59. data/lib/rubocop/cop/style/bisected_attr_accessor.rb +0 -4
  60. data/lib/rubocop/cop/style/case_like_if.rb +0 -4
  61. data/lib/rubocop/cop/style/collection_compact.rb +91 -0
  62. data/lib/rubocop/cop/style/document_dynamic_eval_definition.rb +107 -5
  63. data/lib/rubocop/cop/style/documentation.rb +12 -1
  64. data/lib/rubocop/cop/style/double_negation.rb +6 -1
  65. data/lib/rubocop/cop/style/hash_syntax.rb +3 -3
  66. data/lib/rubocop/cop/style/identical_conditional_branches.rb +7 -2
  67. data/lib/rubocop/cop/style/if_inside_else.rb +37 -1
  68. data/lib/rubocop/cop/style/if_unless_modifier.rb +7 -3
  69. data/lib/rubocop/cop/style/infinite_loop.rb +4 -0
  70. data/lib/rubocop/cop/style/keyword_parameters_order.rb +12 -0
  71. data/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb +2 -2
  72. data/lib/rubocop/cop/style/mixin_grouping.rb +0 -4
  73. data/lib/rubocop/cop/style/multiple_comparison.rb +3 -2
  74. data/lib/rubocop/cop/style/negated_if_else_condition.rb +106 -0
  75. data/lib/rubocop/cop/style/nil_lambda.rb +52 -0
  76. data/lib/rubocop/cop/style/raise_args.rb +21 -6
  77. data/lib/rubocop/cop/style/redundant_argument.rb +73 -0
  78. data/lib/rubocop/cop/style/redundant_regexp_escape.rb +1 -1
  79. data/lib/rubocop/cop/style/static_class.rb +97 -0
  80. data/lib/rubocop/cop/style/while_until_modifier.rb +9 -0
  81. data/lib/rubocop/cop/util.rb +5 -1
  82. data/lib/rubocop/cop/variable_force/branch.rb +1 -1
  83. data/lib/rubocop/cop/variable_force/scope.rb +1 -1
  84. data/lib/rubocop/ext/regexp_node.rb +10 -5
  85. data/lib/rubocop/ext/regexp_parser.rb +9 -2
  86. data/lib/rubocop/formatter/disabled_config_formatter.rb +21 -6
  87. data/lib/rubocop/formatter/formatter_set.rb +1 -0
  88. data/lib/rubocop/formatter/git_hub_actions_formatter.rb +47 -0
  89. data/lib/rubocop/options.rb +7 -0
  90. data/lib/rubocop/rake_task.rb +2 -2
  91. data/lib/rubocop/runner.rb +1 -1
  92. data/lib/rubocop/target_finder.rb +1 -1
  93. data/lib/rubocop/target_ruby.rb +65 -1
  94. data/lib/rubocop/version.rb +1 -1
  95. metadata +14 -8
  96. data/bin/console +0 -10
  97. data/bin/rubocop-profile +0 -32
  98. data/bin/setup +0 -7
@@ -3,7 +3,7 @@
3
3
  module RuboCop
4
4
  # This module holds the RuboCop version information.
5
5
  module Version
6
- STRING = '1.1.0'
6
+ STRING = '1.4.1'
7
7
 
8
8
  MSG = '%<version>s (using Parser %<parser_version>s, '\
9
9
  'rubocop-ast %<rubocop_ast_version>s, ' \
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: 1.1.0
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bozhidar Batsov
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2020-10-29 00:00:00.000000000 Z
13
+ date: 2020-11-23 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: parallel
@@ -94,14 +94,14 @@ dependencies:
94
94
  requirements:
95
95
  - - ">="
96
96
  - !ruby/object:Gem::Version
97
- version: 1.0.1
97
+ version: 1.1.1
98
98
  type: :runtime
99
99
  prerelease: false
100
100
  version_requirements: !ruby/object:Gem::Requirement
101
101
  requirements:
102
102
  - - ">="
103
103
  - !ruby/object:Gem::Version
104
- version: 1.0.1
104
+ version: 1.1.1
105
105
  - !ruby/object:Gem::Dependency
106
106
  name: ruby-progressbar
107
107
  requirement: !ruby/object:Gem::Requirement
@@ -171,9 +171,6 @@ files:
171
171
  - README.md
172
172
  - assets/logo.png
173
173
  - assets/output.html.erb
174
- - bin/console
175
- - bin/rubocop-profile
176
- - bin/setup
177
174
  - config/default.yml
178
175
  - exe/rubocop
179
176
  - lib/rubocop.rb
@@ -347,6 +344,7 @@ files:
347
344
  - lib/rubocop/cop/lint/deprecated_class_methods.rb
348
345
  - lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb
349
346
  - lib/rubocop/cop/lint/disjunctive_assignment_in_constructor.rb
347
+ - lib/rubocop/cop/lint/duplicate_branch.rb
350
348
  - lib/rubocop/cop/lint/duplicate_case_condition.rb
351
349
  - lib/rubocop/cop/lint/duplicate_elsif_condition.rb
352
350
  - lib/rubocop/cop/lint/duplicate_hash_key.rb
@@ -357,6 +355,7 @@ files:
357
355
  - lib/rubocop/cop/lint/each_with_object_argument.rb
358
356
  - lib/rubocop/cop/lint/else_layout.rb
359
357
  - lib/rubocop/cop/lint/empty_block.rb
358
+ - lib/rubocop/cop/lint/empty_class.rb
360
359
  - lib/rubocop/cop/lint/empty_conditional_body.rb
361
360
  - lib/rubocop/cop/lint/empty_ensure.rb
362
361
  - lib/rubocop/cop/lint/empty_expression.rb
@@ -386,6 +385,7 @@ files:
386
385
  - lib/rubocop/cop/lint/nested_method_definition.rb
387
386
  - lib/rubocop/cop/lint/nested_percent_literal.rb
388
387
  - lib/rubocop/cop/lint/next_without_accumulator.rb
388
+ - lib/rubocop/cop/lint/no_return_in_begin_end_blocks.rb
389
389
  - lib/rubocop/cop/lint/non_deterministic_require_order.rb
390
390
  - lib/rubocop/cop/lint/non_local_exit_from_iterator.rb
391
391
  - lib/rubocop/cop/lint/number_conversion.rb
@@ -569,6 +569,7 @@ files:
569
569
  - lib/rubocop/cop/style/class_methods.rb
570
570
  - lib/rubocop/cop/style/class_methods_definitions.rb
571
571
  - lib/rubocop/cop/style/class_vars.rb
572
+ - lib/rubocop/cop/style/collection_compact.rb
572
573
  - lib/rubocop/cop/style/collection_methods.rb
573
574
  - lib/rubocop/cop/style/colon_method_call.rb
574
575
  - lib/rubocop/cop/style/colon_method_definition.rb
@@ -653,6 +654,7 @@ files:
653
654
  - lib/rubocop/cop/style/multiple_comparison.rb
654
655
  - lib/rubocop/cop/style/mutable_constant.rb
655
656
  - lib/rubocop/cop/style/negated_if.rb
657
+ - lib/rubocop/cop/style/negated_if_else_condition.rb
656
658
  - lib/rubocop/cop/style/negated_unless.rb
657
659
  - lib/rubocop/cop/style/negated_while.rb
658
660
  - lib/rubocop/cop/style/nested_modifier.rb
@@ -660,6 +662,7 @@ files:
660
662
  - lib/rubocop/cop/style/nested_ternary_operator.rb
661
663
  - lib/rubocop/cop/style/next.rb
662
664
  - lib/rubocop/cop/style/nil_comparison.rb
665
+ - lib/rubocop/cop/style/nil_lambda.rb
663
666
  - lib/rubocop/cop/style/non_nil_check.rb
664
667
  - lib/rubocop/cop/style/not.rb
665
668
  - lib/rubocop/cop/style/numeric_literal_prefix.rb
@@ -679,6 +682,7 @@ files:
679
682
  - lib/rubocop/cop/style/proc.rb
680
683
  - lib/rubocop/cop/style/raise_args.rb
681
684
  - lib/rubocop/cop/style/random_with_offset.rb
685
+ - lib/rubocop/cop/style/redundant_argument.rb
682
686
  - lib/rubocop/cop/style/redundant_assignment.rb
683
687
  - lib/rubocop/cop/style/redundant_begin.rb
684
688
  - lib/rubocop/cop/style/redundant_capital_w.rb
@@ -715,6 +719,7 @@ files:
715
719
  - lib/rubocop/cop/style/sole_nested_conditional.rb
716
720
  - lib/rubocop/cop/style/special_global_vars.rb
717
721
  - lib/rubocop/cop/style/stabby_lambda_parentheses.rb
722
+ - lib/rubocop/cop/style/static_class.rb
718
723
  - lib/rubocop/cop/style/stderr_puts.rb
719
724
  - lib/rubocop/cop/style/string_concatenation.rb
720
725
  - lib/rubocop/cop/style/string_hash_keys.rb
@@ -775,6 +780,7 @@ files:
775
780
  - lib/rubocop/formatter/file_list_formatter.rb
776
781
  - lib/rubocop/formatter/formatter_set.rb
777
782
  - lib/rubocop/formatter/fuubar_style_formatter.rb
783
+ - lib/rubocop/formatter/git_hub_actions_formatter.rb
778
784
  - lib/rubocop/formatter/html_formatter.rb
779
785
  - lib/rubocop/formatter/json_formatter.rb
780
786
  - lib/rubocop/formatter/junit_formatter.rb
@@ -813,7 +819,7 @@ metadata:
813
819
  homepage_uri: https://rubocop.org/
814
820
  changelog_uri: https://github.com/rubocop-hq/rubocop/blob/master/CHANGELOG.md
815
821
  source_code_uri: https://github.com/rubocop-hq/rubocop/
816
- documentation_uri: https://docs.rubocop.org/rubocop/1.1/
822
+ documentation_uri: https://docs.rubocop.org/rubocop/1.4/
817
823
  bug_tracker_uri: https://github.com/rubocop-hq/rubocop/issues
818
824
  post_install_message:
819
825
  rdoc_options: []
@@ -1,10 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- require 'bundler/setup'
5
- require 'pry'
6
- require 'rubocop'
7
-
8
- ARGV.clear
9
-
10
- RuboCop.pry
@@ -1,32 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- if ARGV.include?('-h') || ARGV.include?('--help')
5
- puts "Usage: same as main `rubocop` command but gathers profiling info"
6
- puts "Additional option: `--memory` to print memory usage"
7
- exit(0)
8
- end
9
- with_mem = ARGV.delete('--memory')
10
- ARGV.unshift '--cache', 'false' unless ARGV.include?('--cache')
11
-
12
- require 'stackprof'
13
- if with_mem
14
- require 'memory_profiler'
15
- MemoryProfiler.start
16
- end
17
- StackProf.start
18
- start = Process.clock_gettime(Process::CLOCK_MONOTONIC)
19
- begin
20
- load "#{__dir__}/../exe/rubocop"
21
- ensure
22
- delta = Process.clock_gettime(Process::CLOCK_MONOTONIC) - start
23
- puts "Finished in #{delta.round(1)} seconds"
24
- StackProf.stop
25
- if with_mem
26
- puts "Building memory report..."
27
- report = MemoryProfiler.stop
28
- end
29
- Dir.mkdir('tmp') unless File.exist?('tmp')
30
- StackProf.results('tmp/stackprof.dump')
31
- report&.pretty_print(scale_bytes: true)
32
- end
data/bin/setup DELETED
@@ -1,7 +0,0 @@
1
- #!/usr/bin/env bash
2
-
3
- set -euo pipefail
4
- IFS=$'\n\t'
5
- set -vx
6
-
7
- bundle install