rubocop 1.52.0 → 1.53.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.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/config/default.yml +38 -1
- data/lib/rubocop/cli/command/lsp.rb +19 -0
- data/lib/rubocop/cli.rb +3 -0
- data/lib/rubocop/config_loader_resolver.rb +4 -3
- data/lib/rubocop/cop/bundler/gem_comment.rb +1 -1
- data/lib/rubocop/cop/bundler/gem_version.rb +2 -2
- data/lib/rubocop/cop/gemspec/dependency_version.rb +2 -2
- data/lib/rubocop/cop/internal_affairs/cop_description.rb +32 -8
- data/lib/rubocop/cop/internal_affairs/node_matcher_directive.rb +3 -3
- data/lib/rubocop/cop/layout/class_structure.rb +7 -0
- data/lib/rubocop/cop/layout/closing_heredoc_indentation.rb +1 -2
- data/lib/rubocop/cop/layout/empty_line_between_defs.rb +1 -1
- data/lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb +2 -0
- data/lib/rubocop/cop/layout/indentation_style.rb +1 -1
- data/lib/rubocop/cop/layout/indentation_width.rb +2 -2
- data/lib/rubocop/cop/layout/redundant_line_break.rb +1 -1
- data/lib/rubocop/cop/layout/space_inside_range_literal.rb +1 -1
- data/lib/rubocop/cop/lint/ambiguous_block_association.rb +2 -1
- data/lib/rubocop/cop/lint/debugger.rb +1 -1
- data/lib/rubocop/cop/lint/duplicate_hash_key.rb +2 -1
- data/lib/rubocop/cop/lint/duplicate_regexp_character_class_element.rb +46 -19
- data/lib/rubocop/cop/lint/erb_new_arguments.rb +1 -2
- data/lib/rubocop/cop/lint/heredoc_method_call_position.rb +1 -1
- data/lib/rubocop/cop/lint/identity_comparison.rb +0 -1
- data/lib/rubocop/cop/lint/incompatible_io_select_with_fiber_scheduler.rb +1 -2
- data/lib/rubocop/cop/lint/inherit_exception.rb +3 -1
- data/lib/rubocop/cop/lint/missing_super.rb +31 -5
- data/lib/rubocop/cop/lint/mixed_case_range.rb +109 -0
- data/lib/rubocop/cop/lint/number_conversion.rb +5 -0
- data/lib/rubocop/cop/lint/ordered_magic_comments.rb +0 -1
- data/lib/rubocop/cop/lint/redundant_regexp_quantifiers.rb +120 -0
- data/lib/rubocop/cop/lint/redundant_require_statement.rb +8 -3
- data/lib/rubocop/cop/lint/redundant_safe_navigation.rb +2 -2
- data/lib/rubocop/cop/lint/send_with_mixin_argument.rb +1 -2
- data/lib/rubocop/cop/lint/shadowed_exception.rb +5 -11
- data/lib/rubocop/cop/lint/suppressed_exception.rb +1 -1
- data/lib/rubocop/cop/lint/useless_assignment.rb +2 -1
- data/lib/rubocop/cop/lint/void.rb +1 -1
- data/lib/rubocop/cop/metrics/utils/abc_size_calculator.rb +1 -2
- data/lib/rubocop/cop/migration/department_name.rb +2 -2
- data/lib/rubocop/cop/mixin/comments_help.rb +1 -1
- data/lib/rubocop/cop/mixin/end_keyword_alignment.rb +1 -1
- data/lib/rubocop/cop/mixin/percent_literal.rb +1 -1
- data/lib/rubocop/cop/naming/block_forwarding.rb +1 -1
- data/lib/rubocop/cop/naming/memoized_instance_variable_name.rb +3 -3
- data/lib/rubocop/cop/style/begin_block.rb +1 -2
- data/lib/rubocop/cop/style/block_comments.rb +1 -1
- data/lib/rubocop/cop/style/block_delimiters.rb +3 -3
- data/lib/rubocop/cop/style/class_equality_comparison.rb +17 -39
- data/lib/rubocop/cop/style/conditional_assignment.rb +3 -1
- data/lib/rubocop/cop/style/dir.rb +1 -1
- data/lib/rubocop/cop/style/dir_empty.rb +8 -14
- data/lib/rubocop/cop/style/document_dynamic_eval_definition.rb +1 -1
- data/lib/rubocop/cop/style/eval_with_location.rb +3 -3
- data/lib/rubocop/cop/style/file_read.rb +2 -2
- data/lib/rubocop/cop/style/hash_transform_keys.rb +2 -2
- data/lib/rubocop/cop/style/hash_transform_values.rb +2 -2
- data/lib/rubocop/cop/style/identical_conditional_branches.rb +6 -2
- data/lib/rubocop/cop/style/invertible_unless_condition.rb +1 -1
- data/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb +2 -2
- data/lib/rubocop/cop/style/preferred_hash_methods.rb +1 -1
- data/lib/rubocop/cop/style/redundant_begin.rb +1 -1
- data/lib/rubocop/cop/style/redundant_conditional.rb +1 -1
- data/lib/rubocop/cop/style/redundant_current_directory_in_path.rb +38 -0
- data/lib/rubocop/cop/style/redundant_line_continuation.rb +2 -2
- data/lib/rubocop/cop/style/redundant_parentheses.rb +1 -1
- data/lib/rubocop/cop/style/redundant_regexp_argument.rb +86 -0
- data/lib/rubocop/cop/style/redundant_regexp_escape.rb +2 -1
- data/lib/rubocop/cop/style/redundant_self_assignment_branch.rb +3 -1
- data/lib/rubocop/cop/style/redundant_sort.rb +1 -1
- data/lib/rubocop/cop/style/redundant_string_escape.rb +2 -0
- data/lib/rubocop/cop/style/return_nil_in_predicate_method_definition.rb +81 -0
- data/lib/rubocop/cop/style/signal_exception.rb +1 -1
- data/lib/rubocop/cop/style/sole_nested_conditional.rb +3 -1
- data/lib/rubocop/cop/style/special_global_vars.rb +1 -2
- data/lib/rubocop/cop/style/yaml_file_read.rb +66 -0
- data/lib/rubocop/cop/util.rb +1 -1
- data/lib/rubocop/cop/utils/regexp_ranges.rb +100 -0
- data/lib/rubocop/cop/variable_force/assignment.rb +14 -1
- data/lib/rubocop/cops_documentation_generator.rb +1 -1
- data/lib/rubocop/ext/regexp_parser.rb +4 -1
- data/lib/rubocop/lsp/logger.rb +22 -0
- data/lib/rubocop/lsp/routes.rb +223 -0
- data/lib/rubocop/lsp/runtime.rb +79 -0
- data/lib/rubocop/lsp/server.rb +62 -0
- data/lib/rubocop/lsp/severity.rb +27 -0
- data/lib/rubocop/options.rb +11 -1
- data/lib/rubocop/version.rb +1 -1
- data/lib/rubocop.rb +8 -0
- metadata +36 -9
data/lib/rubocop.rb
CHANGED
@@ -139,6 +139,7 @@ require_relative 'rubocop/cop/mixin/comments_help' # relies on visibility_help
|
|
139
139
|
require_relative 'rubocop/cop/mixin/def_node' # relies on visibility_help
|
140
140
|
|
141
141
|
require_relative 'rubocop/cop/utils/format_string'
|
142
|
+
require_relative 'rubocop/cop/utils/regexp_ranges'
|
142
143
|
|
143
144
|
require_relative 'rubocop/cop/migration/department_name'
|
144
145
|
|
@@ -336,6 +337,7 @@ require_relative 'rubocop/cop/lint/literal_in_interpolation'
|
|
336
337
|
require_relative 'rubocop/cop/lint/loop'
|
337
338
|
require_relative 'rubocop/cop/lint/missing_cop_enable_directive'
|
338
339
|
require_relative 'rubocop/cop/lint/missing_super'
|
340
|
+
require_relative 'rubocop/cop/lint/mixed_case_range'
|
339
341
|
require_relative 'rubocop/cop/lint/mixed_regexp_capture_types'
|
340
342
|
require_relative 'rubocop/cop/lint/multiple_comparison'
|
341
343
|
require_relative 'rubocop/cop/lint/nested_method_definition'
|
@@ -358,6 +360,7 @@ require_relative 'rubocop/cop/lint/rand_one'
|
|
358
360
|
require_relative 'rubocop/cop/lint/redundant_cop_disable_directive'
|
359
361
|
require_relative 'rubocop/cop/lint/redundant_cop_enable_directive'
|
360
362
|
require_relative 'rubocop/cop/lint/redundant_dir_glob_sort'
|
363
|
+
require_relative 'rubocop/cop/lint/redundant_regexp_quantifiers'
|
361
364
|
require_relative 'rubocop/cop/lint/redundant_require_statement'
|
362
365
|
require_relative 'rubocop/cop/lint/redundant_safe_navigation'
|
363
366
|
require_relative 'rubocop/cop/lint/redundant_splat_expansion'
|
@@ -562,6 +565,7 @@ require_relative 'rubocop/cop/style/operator_method_call'
|
|
562
565
|
require_relative 'rubocop/cop/style/redundant_array_constructor'
|
563
566
|
require_relative 'rubocop/cop/style/redundant_assignment'
|
564
567
|
require_relative 'rubocop/cop/style/redundant_constant_base'
|
568
|
+
require_relative 'rubocop/cop/style/redundant_current_directory_in_path'
|
565
569
|
require_relative 'rubocop/cop/style/redundant_double_splat_hash_braces'
|
566
570
|
require_relative 'rubocop/cop/style/redundant_each'
|
567
571
|
require_relative 'rubocop/cop/style/redundant_fetch_block'
|
@@ -570,6 +574,7 @@ require_relative 'rubocop/cop/style/redundant_filter_chain'
|
|
570
574
|
require_relative 'rubocop/cop/style/redundant_heredoc_delimiter_quotes'
|
571
575
|
require_relative 'rubocop/cop/style/redundant_initialize'
|
572
576
|
require_relative 'rubocop/cop/style/redundant_line_continuation'
|
577
|
+
require_relative 'rubocop/cop/style/redundant_regexp_argument'
|
573
578
|
require_relative 'rubocop/cop/style/redundant_regexp_constructor'
|
574
579
|
require_relative 'rubocop/cop/style/redundant_self_assignment'
|
575
580
|
require_relative 'rubocop/cop/style/redundant_self_assignment_branch'
|
@@ -648,6 +653,7 @@ require_relative 'rubocop/cop/style/regexp_literal'
|
|
648
653
|
require_relative 'rubocop/cop/style/rescue_modifier'
|
649
654
|
require_relative 'rubocop/cop/style/rescue_standard_error'
|
650
655
|
require_relative 'rubocop/cop/style/return_nil'
|
656
|
+
require_relative 'rubocop/cop/style/return_nil_in_predicate_method_definition'
|
651
657
|
require_relative 'rubocop/cop/style/safe_navigation'
|
652
658
|
require_relative 'rubocop/cop/style/sample'
|
653
659
|
require_relative 'rubocop/cop/style/select_by_regexp'
|
@@ -694,6 +700,7 @@ require_relative 'rubocop/cop/style/when_then'
|
|
694
700
|
require_relative 'rubocop/cop/style/while_until_do'
|
695
701
|
require_relative 'rubocop/cop/style/while_until_modifier'
|
696
702
|
require_relative 'rubocop/cop/style/word_array'
|
703
|
+
require_relative 'rubocop/cop/style/yaml_file_read'
|
697
704
|
require_relative 'rubocop/cop/style/yoda_condition'
|
698
705
|
require_relative 'rubocop/cop/style/yoda_expression'
|
699
706
|
require_relative 'rubocop/cop/style/zero_length_predicate'
|
@@ -739,6 +746,7 @@ require_relative 'rubocop/cli/command/base'
|
|
739
746
|
require_relative 'rubocop/cli/command/auto_generate_config'
|
740
747
|
require_relative 'rubocop/cli/command/execute_runner'
|
741
748
|
require_relative 'rubocop/cli/command/init_dotfile'
|
749
|
+
require_relative 'rubocop/cli/command/lsp'
|
742
750
|
require_relative 'rubocop/cli/command/show_cops'
|
743
751
|
require_relative 'rubocop/cli/command/show_docs_url'
|
744
752
|
require_relative 'rubocop/cli/command/suggest_extensions'
|
metadata
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubocop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.53.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bozhidar Batsov
|
8
8
|
- Jonas Arvidsson
|
9
9
|
- Yuji Nakayama
|
10
|
-
autorequire:
|
10
|
+
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date: 2023-06-
|
13
|
+
date: 2023-06-23 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: json
|
@@ -26,6 +26,20 @@ dependencies:
|
|
26
26
|
- - "~>"
|
27
27
|
- !ruby/object:Gem::Version
|
28
28
|
version: '2.3'
|
29
|
+
- !ruby/object:Gem::Dependency
|
30
|
+
name: language_server-protocol
|
31
|
+
requirement: !ruby/object:Gem::Requirement
|
32
|
+
requirements:
|
33
|
+
- - ">="
|
34
|
+
- !ruby/object:Gem::Version
|
35
|
+
version: 3.17.0
|
36
|
+
type: :runtime
|
37
|
+
prerelease: false
|
38
|
+
version_requirements: !ruby/object:Gem::Requirement
|
39
|
+
requirements:
|
40
|
+
- - ">="
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: 3.17.0
|
29
43
|
- !ruby/object:Gem::Dependency
|
30
44
|
name: parallel
|
31
45
|
requirement: !ruby/object:Gem::Requirement
|
@@ -46,14 +60,14 @@ dependencies:
|
|
46
60
|
requirements:
|
47
61
|
- - ">="
|
48
62
|
- !ruby/object:Gem::Version
|
49
|
-
version: 3.2.
|
63
|
+
version: 3.2.2.3
|
50
64
|
type: :runtime
|
51
65
|
prerelease: false
|
52
66
|
version_requirements: !ruby/object:Gem::Requirement
|
53
67
|
requirements:
|
54
68
|
- - ">="
|
55
69
|
- !ruby/object:Gem::Version
|
56
|
-
version: 3.2.
|
70
|
+
version: 3.2.2.3
|
57
71
|
- !ruby/object:Gem::Dependency
|
58
72
|
name: rainbow
|
59
73
|
requirement: !ruby/object:Gem::Requirement
|
@@ -198,6 +212,7 @@ files:
|
|
198
212
|
- lib/rubocop/cli/command/base.rb
|
199
213
|
- lib/rubocop/cli/command/execute_runner.rb
|
200
214
|
- lib/rubocop/cli/command/init_dotfile.rb
|
215
|
+
- lib/rubocop/cli/command/lsp.rb
|
201
216
|
- lib/rubocop/cli/command/show_cops.rb
|
202
217
|
- lib/rubocop/cli/command/show_docs_url.rb
|
203
218
|
- lib/rubocop/cli/command/suggest_extensions.rb
|
@@ -456,6 +471,7 @@ files:
|
|
456
471
|
- lib/rubocop/cop/lint/loop.rb
|
457
472
|
- lib/rubocop/cop/lint/missing_cop_enable_directive.rb
|
458
473
|
- lib/rubocop/cop/lint/missing_super.rb
|
474
|
+
- lib/rubocop/cop/lint/mixed_case_range.rb
|
459
475
|
- lib/rubocop/cop/lint/mixed_regexp_capture_types.rb
|
460
476
|
- lib/rubocop/cop/lint/multiple_comparison.rb
|
461
477
|
- lib/rubocop/cop/lint/nested_method_definition.rb
|
@@ -478,6 +494,7 @@ files:
|
|
478
494
|
- lib/rubocop/cop/lint/redundant_cop_disable_directive.rb
|
479
495
|
- lib/rubocop/cop/lint/redundant_cop_enable_directive.rb
|
480
496
|
- lib/rubocop/cop/lint/redundant_dir_glob_sort.rb
|
497
|
+
- lib/rubocop/cop/lint/redundant_regexp_quantifiers.rb
|
481
498
|
- lib/rubocop/cop/lint/redundant_require_statement.rb
|
482
499
|
- lib/rubocop/cop/lint/redundant_safe_navigation.rb
|
483
500
|
- lib/rubocop/cop/lint/redundant_splat_expansion.rb
|
@@ -823,6 +840,7 @@ files:
|
|
823
840
|
- lib/rubocop/cop/style/redundant_condition.rb
|
824
841
|
- lib/rubocop/cop/style/redundant_conditional.rb
|
825
842
|
- lib/rubocop/cop/style/redundant_constant_base.rb
|
843
|
+
- lib/rubocop/cop/style/redundant_current_directory_in_path.rb
|
826
844
|
- lib/rubocop/cop/style/redundant_double_splat_hash_braces.rb
|
827
845
|
- lib/rubocop/cop/style/redundant_each.rb
|
828
846
|
- lib/rubocop/cop/style/redundant_exception.rb
|
@@ -836,6 +854,7 @@ files:
|
|
836
854
|
- lib/rubocop/cop/style/redundant_line_continuation.rb
|
837
855
|
- lib/rubocop/cop/style/redundant_parentheses.rb
|
838
856
|
- lib/rubocop/cop/style/redundant_percent_q.rb
|
857
|
+
- lib/rubocop/cop/style/redundant_regexp_argument.rb
|
839
858
|
- lib/rubocop/cop/style/redundant_regexp_character_class.rb
|
840
859
|
- lib/rubocop/cop/style/redundant_regexp_constructor.rb
|
841
860
|
- lib/rubocop/cop/style/redundant_regexp_escape.rb
|
@@ -851,6 +870,7 @@ files:
|
|
851
870
|
- lib/rubocop/cop/style/rescue_modifier.rb
|
852
871
|
- lib/rubocop/cop/style/rescue_standard_error.rb
|
853
872
|
- lib/rubocop/cop/style/return_nil.rb
|
873
|
+
- lib/rubocop/cop/style/return_nil_in_predicate_method_definition.rb
|
854
874
|
- lib/rubocop/cop/style/safe_navigation.rb
|
855
875
|
- lib/rubocop/cop/style/sample.rb
|
856
876
|
- lib/rubocop/cop/style/select_by_regexp.rb
|
@@ -899,12 +919,14 @@ files:
|
|
899
919
|
- lib/rubocop/cop/style/while_until_do.rb
|
900
920
|
- lib/rubocop/cop/style/while_until_modifier.rb
|
901
921
|
- lib/rubocop/cop/style/word_array.rb
|
922
|
+
- lib/rubocop/cop/style/yaml_file_read.rb
|
902
923
|
- lib/rubocop/cop/style/yoda_condition.rb
|
903
924
|
- lib/rubocop/cop/style/yoda_expression.rb
|
904
925
|
- lib/rubocop/cop/style/zero_length_predicate.rb
|
905
926
|
- lib/rubocop/cop/team.rb
|
906
927
|
- lib/rubocop/cop/util.rb
|
907
928
|
- lib/rubocop/cop/utils/format_string.rb
|
929
|
+
- lib/rubocop/cop/utils/regexp_ranges.rb
|
908
930
|
- lib/rubocop/cop/variable_force.rb
|
909
931
|
- lib/rubocop/cop/variable_force/assignment.rb
|
910
932
|
- lib/rubocop/cop/variable_force/branch.rb
|
@@ -949,6 +971,11 @@ files:
|
|
949
971
|
- lib/rubocop/formatter/text_util.rb
|
950
972
|
- lib/rubocop/formatter/worst_offenders_formatter.rb
|
951
973
|
- lib/rubocop/lockfile.rb
|
974
|
+
- lib/rubocop/lsp/logger.rb
|
975
|
+
- lib/rubocop/lsp/routes.rb
|
976
|
+
- lib/rubocop/lsp/runtime.rb
|
977
|
+
- lib/rubocop/lsp/server.rb
|
978
|
+
- lib/rubocop/lsp/severity.rb
|
952
979
|
- lib/rubocop/magic_comment.rb
|
953
980
|
- lib/rubocop/name_similarity.rb
|
954
981
|
- lib/rubocop/options.rb
|
@@ -996,10 +1023,10 @@ metadata:
|
|
996
1023
|
homepage_uri: https://rubocop.org/
|
997
1024
|
changelog_uri: https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md
|
998
1025
|
source_code_uri: https://github.com/rubocop/rubocop/
|
999
|
-
documentation_uri: https://docs.rubocop.org/rubocop/1.
|
1026
|
+
documentation_uri: https://docs.rubocop.org/rubocop/1.53/
|
1000
1027
|
bug_tracker_uri: https://github.com/rubocop/rubocop/issues
|
1001
1028
|
rubygems_mfa_required: 'true'
|
1002
|
-
post_install_message:
|
1029
|
+
post_install_message:
|
1003
1030
|
rdoc_options: []
|
1004
1031
|
require_paths:
|
1005
1032
|
- lib
|
@@ -1014,8 +1041,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
1014
1041
|
- !ruby/object:Gem::Version
|
1015
1042
|
version: '0'
|
1016
1043
|
requirements: []
|
1017
|
-
rubygems_version: 3.
|
1018
|
-
signing_key:
|
1044
|
+
rubygems_version: 3.4.6
|
1045
|
+
signing_key:
|
1019
1046
|
specification_version: 4
|
1020
1047
|
summary: Automatic Ruby code style checking tool.
|
1021
1048
|
test_files: []
|