rubocop 1.28.2 → 1.29.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.
Files changed (81) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -3
  3. data/config/default.yml +21 -6
  4. data/lib/rubocop/cop/badge.rb +1 -1
  5. data/lib/rubocop/cop/bundler/duplicated_gem.rb +1 -1
  6. data/lib/rubocop/cop/bundler/gem_comment.rb +1 -1
  7. data/lib/rubocop/cop/gemspec/dependency_version.rb +156 -0
  8. data/lib/rubocop/cop/gemspec/duplicated_assignment.rb +3 -6
  9. data/lib/rubocop/cop/gemspec/ruby_version_globals_usage.rb +1 -1
  10. data/lib/rubocop/cop/internal_affairs/method_name_end_with.rb +80 -0
  11. data/lib/rubocop/cop/internal_affairs.rb +1 -0
  12. data/lib/rubocop/cop/layout/comment_indentation.rb +1 -1
  13. data/lib/rubocop/cop/layout/line_end_string_concatenation_indentation.rb +1 -1
  14. data/lib/rubocop/cop/layout/space_around_block_parameters.rb +1 -1
  15. data/lib/rubocop/cop/layout/space_inside_reference_brackets.rb +1 -1
  16. data/lib/rubocop/cop/layout/trailing_empty_lines.rb +1 -1
  17. data/lib/rubocop/cop/lint/ambiguous_range.rb +2 -2
  18. data/lib/rubocop/cop/lint/erb_new_arguments.rb +0 -3
  19. data/lib/rubocop/cop/lint/loop.rb +1 -1
  20. data/lib/rubocop/cop/lint/non_deterministic_require_order.rb +1 -1
  21. data/lib/rubocop/cop/lint/or_assignment_to_constant.rb +1 -1
  22. data/lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb +1 -1
  23. data/lib/rubocop/cop/lint/raise_exception.rb +1 -1
  24. data/lib/rubocop/cop/lint/return_in_void_context.rb +5 -17
  25. data/lib/rubocop/cop/lint/useless_times.rb +1 -1
  26. data/lib/rubocop/cop/mixin/duplication.rb +1 -1
  27. data/lib/rubocop/cop/mixin/preferred_delimiters.rb +2 -2
  28. data/lib/rubocop/cop/mixin/statement_modifier.rb +1 -1
  29. data/lib/rubocop/cop/mixin/trailing_comma.rb +1 -1
  30. data/lib/rubocop/cop/naming/block_forwarding.rb +1 -1
  31. data/lib/rubocop/cop/naming/file_name.rb +1 -1
  32. data/lib/rubocop/cop/naming/predicate_name.rb +2 -2
  33. data/lib/rubocop/cop/naming/variable_name.rb +9 -0
  34. data/lib/rubocop/cop/naming/variable_number.rb +10 -0
  35. data/lib/rubocop/cop/security/yaml_load.rb +1 -1
  36. data/lib/rubocop/cop/style/alias.rb +3 -3
  37. data/lib/rubocop/cop/style/and_or.rb +1 -1
  38. data/lib/rubocop/cop/style/bisected_attr_accessor/macro.rb +1 -1
  39. data/lib/rubocop/cop/style/case_like_if.rb +1 -1
  40. data/lib/rubocop/cop/style/character_literal.rb +1 -1
  41. data/lib/rubocop/cop/style/collection_compact.rb +3 -3
  42. data/lib/rubocop/cop/style/date_time.rb +1 -1
  43. data/lib/rubocop/cop/style/double_negation.rb +28 -2
  44. data/lib/rubocop/cop/style/empty_case_condition.rb +1 -1
  45. data/lib/rubocop/cop/style/empty_literal.rb +1 -1
  46. data/lib/rubocop/cop/style/env_home.rb +56 -0
  47. data/lib/rubocop/cop/style/fetch_env_var.rb +238 -11
  48. data/lib/rubocop/cop/style/identical_conditional_branches.rb +2 -2
  49. data/lib/rubocop/cop/style/map_to_hash.rb +0 -3
  50. data/lib/rubocop/cop/style/mixin_grouping.rb +1 -1
  51. data/lib/rubocop/cop/style/multiline_ternary_operator.rb +5 -1
  52. data/lib/rubocop/cop/style/next.rb +1 -1
  53. data/lib/rubocop/cop/style/optional_arguments.rb +1 -1
  54. data/lib/rubocop/cop/style/optional_boolean_parameter.rb +1 -1
  55. data/lib/rubocop/cop/style/quoted_symbols.rb +1 -1
  56. data/lib/rubocop/cop/style/raise_args.rb +1 -1
  57. data/lib/rubocop/cop/style/redundant_condition.rb +77 -7
  58. data/lib/rubocop/cop/style/redundant_regexp_character_class.rb +1 -1
  59. data/lib/rubocop/cop/style/redundant_regexp_escape.rb +1 -1
  60. data/lib/rubocop/cop/style/redundant_self_assignment.rb +1 -2
  61. data/lib/rubocop/cop/style/safe_navigation.rb +1 -1
  62. data/lib/rubocop/cop/style/slicing_with_range.rb +0 -3
  63. data/lib/rubocop/cop/style/string_chars.rb +1 -1
  64. data/lib/rubocop/cop/style/trivial_accessors.rb +7 -8
  65. data/lib/rubocop/cops_documentation_generator.rb +1 -1
  66. data/lib/rubocop/formatter/formatter_set.rb +1 -0
  67. data/lib/rubocop/formatter/html_formatter.rb +2 -9
  68. data/lib/rubocop/formatter/markdown_formatter.rb +76 -0
  69. data/lib/rubocop/magic_comment.rb +4 -3
  70. data/lib/rubocop/options.rb +4 -3
  71. data/lib/rubocop/result_cache.rb +1 -1
  72. data/lib/rubocop/rspec/cop_helper.rb +1 -1
  73. data/lib/rubocop/rspec/parallel_formatter.rb +1 -1
  74. data/lib/rubocop/rspec/shared_contexts.rb +1 -5
  75. data/lib/rubocop/runner.rb +1 -1
  76. data/lib/rubocop/string_interpreter.rb +4 -4
  77. data/lib/rubocop/target_ruby.rb +8 -2
  78. data/lib/rubocop/version.rb +1 -1
  79. data/lib/rubocop.rb +3 -1
  80. metadata +17 -8
  81. data/lib/rubocop/cop/lint/useless_else_without_rescue.rb +0 -45
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.28.2
4
+ version: 1.29.0
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: 2022-04-25 00:00:00.000000000 Z
13
+ date: 2022-05-06 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: parallel
@@ -86,14 +86,20 @@ dependencies:
86
86
  requirements:
87
87
  - - ">="
88
88
  - !ruby/object:Gem::Version
89
- version: '0'
89
+ version: 3.2.5
90
+ - - "<"
91
+ - !ruby/object:Gem::Version
92
+ version: '4.0'
90
93
  type: :runtime
91
94
  prerelease: false
92
95
  version_requirements: !ruby/object:Gem::Requirement
93
96
  requirements:
94
97
  - - ">="
95
98
  - !ruby/object:Gem::Version
96
- version: '0'
99
+ version: 3.2.5
100
+ - - "<"
101
+ - !ruby/object:Gem::Version
102
+ version: '4.0'
97
103
  - !ruby/object:Gem::Dependency
98
104
  name: rubocop-ast
99
105
  requirement: !ruby/object:Gem::Requirement
@@ -250,6 +256,7 @@ files:
250
256
  - lib/rubocop/cop/exclude_limit.rb
251
257
  - lib/rubocop/cop/force.rb
252
258
  - lib/rubocop/cop/gemspec/date_assignment.rb
259
+ - lib/rubocop/cop/gemspec/dependency_version.rb
253
260
  - lib/rubocop/cop/gemspec/duplicated_assignment.rb
254
261
  - lib/rubocop/cop/gemspec/ordered_dependencies.rb
255
262
  - lib/rubocop/cop/gemspec/require_mfa.rb
@@ -264,6 +271,7 @@ files:
264
271
  - lib/rubocop/cop/internal_affairs/example_description.rb
265
272
  - lib/rubocop/cop/internal_affairs/inherit_deprecated_cop_class.rb
266
273
  - lib/rubocop/cop/internal_affairs/location_line_equality_comparison.rb
274
+ - lib/rubocop/cop/internal_affairs/method_name_end_with.rb
267
275
  - lib/rubocop/cop/internal_affairs/method_name_equal.rb
268
276
  - lib/rubocop/cop/internal_affairs/node_destructuring.rb
269
277
  - lib/rubocop/cop/internal_affairs/node_matcher_directive.rb
@@ -497,7 +505,6 @@ files:
497
505
  - lib/rubocop/cop/lint/uri_regexp.rb
498
506
  - lib/rubocop/cop/lint/useless_access_modifier.rb
499
507
  - lib/rubocop/cop/lint/useless_assignment.rb
500
- - lib/rubocop/cop/lint/useless_else_without_rescue.rb
501
508
  - lib/rubocop/cop/lint/useless_method_definition.rb
502
509
  - lib/rubocop/cop/lint/useless_ruby2_keywords.rb
503
510
  - lib/rubocop/cop/lint/useless_setter_call.rb
@@ -674,6 +681,7 @@ files:
674
681
  - lib/rubocop/cop/style/encoding.rb
675
682
  - lib/rubocop/cop/style/end_block.rb
676
683
  - lib/rubocop/cop/style/endless_method.rb
684
+ - lib/rubocop/cop/style/env_home.rb
677
685
  - lib/rubocop/cop/style/eval_with_location.rb
678
686
  - lib/rubocop/cop/style/even_odd.rb
679
687
  - lib/rubocop/cop/style/expand_path_arguments.rb
@@ -880,6 +888,7 @@ files:
880
888
  - lib/rubocop/formatter/html_formatter.rb
881
889
  - lib/rubocop/formatter/json_formatter.rb
882
890
  - lib/rubocop/formatter/junit_formatter.rb
891
+ - lib/rubocop/formatter/markdown_formatter.rb
883
892
  - lib/rubocop/formatter/offense_count_formatter.rb
884
893
  - lib/rubocop/formatter/pacman_formatter.rb
885
894
  - lib/rubocop/formatter/progress_formatter.rb
@@ -918,7 +927,7 @@ metadata:
918
927
  homepage_uri: https://rubocop.org/
919
928
  changelog_uri: https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md
920
929
  source_code_uri: https://github.com/rubocop/rubocop/
921
- documentation_uri: https://docs.rubocop.org/rubocop/1.28/
930
+ documentation_uri: https://docs.rubocop.org/rubocop/1.29/
922
931
  bug_tracker_uri: https://github.com/rubocop/rubocop/issues
923
932
  rubygems_mfa_required: 'true'
924
933
  post_install_message:
@@ -929,14 +938,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
929
938
  requirements:
930
939
  - - ">="
931
940
  - !ruby/object:Gem::Version
932
- version: 2.5.0
941
+ version: 2.6.0
933
942
  required_rubygems_version: !ruby/object:Gem::Requirement
934
943
  requirements:
935
944
  - - ">="
936
945
  - !ruby/object:Gem::Version
937
946
  version: '0'
938
947
  requirements: []
939
- rubygems_version: 3.1.2
948
+ rubygems_version: 3.2.22
940
949
  signing_key:
941
950
  specification_version: 4
942
951
  summary: Automatic Ruby code style checking tool.
@@ -1,45 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module RuboCop
4
- module Cop
5
- module Lint
6
- # This cop checks for useless `else` in `begin..end` without `rescue`.
7
- #
8
- # NOTE: This syntax is no longer valid on Ruby 2.6 or higher and
9
- # this cop is going to be removed at some point the future.
10
- #
11
- # @example
12
- #
13
- # # bad
14
- #
15
- # begin
16
- # do_something
17
- # else
18
- # do_something_else # This will never be run.
19
- # end
20
- #
21
- # @example
22
- #
23
- # # good
24
- #
25
- # begin
26
- # do_something
27
- # rescue
28
- # handle_errors
29
- # else
30
- # do_something_else
31
- # end
32
- class UselessElseWithoutRescue < Base
33
- MSG = '`else` without `rescue` is useless.'
34
-
35
- def on_new_investigation
36
- processed_source.diagnostics.each do |diagnostic|
37
- next unless diagnostic.reason == :useless_else
38
-
39
- add_offense(diagnostic.location, severity: diagnostic.level)
40
- end
41
- end
42
- end
43
- end
44
- end
45
- end