rubocop_todo_corrector 0.18.3 → 0.19.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 25ac7e09590def3db785d3533f3fe869a7f77435bbae9c1c9d793f1af4e50eda
4
- data.tar.gz: 6cb4c47b631d5eaaa20a577ea0d6cce9dec0385c699e7c9268bcbdafe4a64ba3
3
+ metadata.gz: 68b211bc9decd9f8d28650ff756116e04c83ac7501920bf24c13d7d736783ec1
4
+ data.tar.gz: 2d3990998388db22f18ad4cdfa6b9573243663b856d5d5111a40582f25292630
5
5
  SHA512:
6
- metadata.gz: 5669d1961eeed46cbe0d94932aee83b5d49bf2c71de04e07b5b13b1eecd28ae5103fd19d5b589e6fd1c2b1d579addd1d01757089e724c556252a96da74b6b894
7
- data.tar.gz: ce24d57dcf9c4a21a2204f2e8d5d9c8d59edeba738d8ca97f38b072c74807234e935db178d1d9a0387c39fcd661c0491253981f2ceac95531a58b9acf4575ae7
6
+ metadata.gz: ae8feb9132ac6b9ab54cb2ba780b543794088305a2b005f2a9231094a4b28144d1341c3902a6f61167e4fc70cf4de8d4a1890a6f03e3c0cd300e5f4f6ec73321
7
+ data.tar.gz: 31112b957b0a809f2c1fd1ea1ffaf8ef07a7da9dd6774b57a2945a55b3e06f10d00f811e578ef6dddbe859cb86e119a02d73ccbbb22d13531136b0b9db9baee4
data/.rubocop.yml CHANGED
@@ -1,10 +1,10 @@
1
- require:
1
+ plugins:
2
2
  - rubocop-rake
3
3
  - rubocop-rspec
4
4
 
5
5
  AllCops:
6
6
  NewCops: enable
7
- TargetRubyVersion: 3.1
7
+ TargetRubyVersion: 3.3
8
8
 
9
9
  Metrics:
10
10
  Enabled: false
data/Gemfile.lock CHANGED
@@ -1,29 +1,32 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rubocop_todo_corrector (0.18.3)
4
+ rubocop_todo_corrector (0.19.0)
5
5
  asciidoctor
6
6
  bundler
7
+ logger
7
8
  thor
8
9
  yard
9
10
 
10
11
  GEM
11
12
  remote: https://rubygems.org/
12
13
  specs:
13
- asciidoctor (2.0.23)
14
- ast (2.4.2)
14
+ asciidoctor (2.0.26)
15
+ ast (2.4.3)
15
16
  diff-lcs (1.5.1)
16
- json (2.7.2)
17
- language_server-protocol (3.17.0.3)
18
- parallel (1.24.0)
19
- parser (3.3.1.0)
17
+ json (3.1.0)
18
+ language_server-protocol (3.17.0.6)
19
+ lint_roller (1.1.0)
20
+ logger (1.7.0)
21
+ parallel (2.3.0)
22
+ parser (3.3.13.0)
20
23
  ast (~> 2.4.1)
21
24
  racc
22
- racc (1.7.3)
25
+ prism (1.9.0)
26
+ racc (1.8.1)
23
27
  rainbow (3.1.1)
24
28
  rake (13.2.1)
25
- regexp_parser (2.9.0)
26
- rexml (3.2.6)
29
+ regexp_parser (2.13.1)
27
30
  rspec (3.13.0)
28
31
  rspec-core (~> 3.13.0)
29
32
  rspec-expectations (~> 3.13.0)
@@ -37,35 +40,32 @@ GEM
37
40
  diff-lcs (>= 1.2.0, < 2.0)
38
41
  rspec-support (~> 3.13.0)
39
42
  rspec-support (3.13.1)
40
- rubocop (1.63.4)
41
- json (~> 2.3)
42
- language_server-protocol (>= 3.17.0)
43
- parallel (~> 1.10)
43
+ rubocop (1.92.2)
44
+ json (>= 2.3)
45
+ language_server-protocol (~> 3.17.0.2)
46
+ lint_roller (~> 1.1.0)
47
+ parallel (>= 1.10)
44
48
  parser (>= 3.3.0.2)
45
49
  rainbow (>= 2.2.2, < 4.0)
46
- regexp_parser (>= 1.8, < 3.0)
47
- rexml (>= 3.2.5, < 4.0)
48
- rubocop-ast (>= 1.31.1, < 2.0)
50
+ regexp_parser (>= 2.11.3, < 3.0)
51
+ rubocop-ast (>= 1.49.0, < 2.0)
49
52
  ruby-progressbar (~> 1.7)
50
- unicode-display_width (>= 2.4.0, < 3.0)
51
- rubocop-ast (1.31.3)
52
- parser (>= 3.3.1.0)
53
- rubocop-capybara (2.20.0)
54
- rubocop (~> 1.41)
55
- rubocop-factory_bot (2.25.1)
56
- rubocop (~> 1.41)
57
- rubocop-rake (0.6.0)
58
- rubocop (~> 1.0)
59
- rubocop-rspec (2.29.1)
60
- rubocop (~> 1.40)
61
- rubocop-capybara (~> 2.17)
62
- rubocop-factory_bot (~> 2.22)
63
- rubocop-rspec_rails (~> 2.28)
64
- rubocop-rspec_rails (2.28.3)
65
- rubocop (~> 1.40)
53
+ unicode-display_width (>= 2.4.0, < 4.0)
54
+ rubocop-ast (1.50.0)
55
+ parser (>= 3.3.7.2)
56
+ prism (~> 1.7)
57
+ rubocop-rake (0.7.1)
58
+ lint_roller (~> 1.1)
59
+ rubocop (>= 1.72.1)
60
+ rubocop-rspec (3.10.2)
61
+ lint_roller (~> 1.1)
62
+ regexp_parser (>= 2.0)
63
+ rubocop (~> 1.86, >= 1.86.2)
66
64
  ruby-progressbar (1.13.0)
67
65
  thor (1.4.0)
68
- unicode-display_width (2.5.0)
66
+ unicode-display_width (3.3.0)
67
+ unicode-emoji (~> 4.3)
68
+ unicode-emoji (4.3.0)
69
69
  yard (0.9.37)
70
70
 
71
71
  PLATFORMS
@@ -81,4 +81,4 @@ DEPENDENCIES
81
81
  rubocop_todo_corrector!
82
82
 
83
83
  BUNDLED WITH
84
- 2.3.13
84
+ 4.0.20
data/README.md CHANGED
@@ -1,7 +1,5 @@
1
1
  # RubocopTodoCorrector
2
2
 
3
- [![test](https://github.com/r7kamura/rubocop_todo_corrector/actions/workflows/test.yml/badge.svg)](https://github.com/r7kamura/rubocop_todo_corrector/actions/workflows/test.yml)
4
-
5
3
  Autocorrect offenses defined in `.rubocop_todo.yml`.
6
4
 
7
5
  This is an internal implementation of [rubocop-todo-corrector](https://github.com/r7kamura/rubocop-todo-corrector) action. See its README for more information about this action.
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'pathname'
4
- require 'set'
5
4
 
6
5
  module RubocopTodoCorrector
7
6
  module Commands
@@ -39,10 +39,17 @@ module RubocopTodoCorrector
39
39
  def capture
40
40
  ::Open3.capture2(
41
41
  { 'BUNDLE_GEMFILE' => @temporary_gemfile_path },
42
- "bundle exec ruby -e 'Bundler.require; print Object.const_source_location(#{cop_class_name.inspect}).first'"
42
+ "bundle exec ruby -e 'Bundler.require; #{ruby_code}'"
43
43
  ).first
44
44
  end
45
45
 
46
+ # Recent RuboCop versions lazy-load cops with autoload, so the constant needs to be loaded before
47
+ # `Object.const_source_location`. Otherwise it returns the location of the autoload call.
48
+ # @return [String]
49
+ def ruby_code
50
+ "Object.const_get(#{cop_class_name.inspect}); print Object.const_source_location(#{cop_class_name.inspect}).first"
51
+ end
52
+
46
53
  # @return [String]
47
54
  def cop_class_name
48
55
  "RuboCop::Cop::#{@cop_name.gsub('/', '::')}"
@@ -18,18 +18,18 @@ module RubocopTodoCorrector
18
18
  # @return [Hash]
19
19
  def call
20
20
  {
21
- auto_correctable:,
21
+ auto_correctable: auto_correctable?,
22
22
  name:,
23
23
  offenses_count:,
24
- safe_auto_correctable:
24
+ safe_auto_correctable: safe_auto_correctable?
25
25
  }
26
26
  end
27
27
 
28
28
  private
29
29
 
30
30
  # @return [Boolean]
31
- def auto_correctable
32
- safe_auto_correctable || unsafe_auto_correctable
31
+ def auto_correctable?
32
+ safe_auto_correctable? || unsafe_auto_correctable?
33
33
  end
34
34
 
35
35
  # @return [String, nil]
@@ -45,13 +45,13 @@ module RubocopTodoCorrector
45
45
  ]&.to_i
46
46
  end
47
47
 
48
- def safe_auto_correctable
48
+ def safe_auto_correctable?
49
49
  @content.include?('# Cop supports --auto-correct.') || # Before rubocop 1.26
50
50
  @content.include?('# This cop supports safe auto-correction') || # Before rubocop 1.30
51
51
  @content.include?('# This cop supports safe autocorrection')
52
52
  end
53
53
 
54
- def unsafe_auto_correctable
54
+ def unsafe_auto_correctable?
55
55
  @content.include?('# Cop supports --auto-correct-all') ||
56
56
  @content.include?('# This cop supports unsafe auto-correction') ||
57
57
  @content.include?('# This cop supports unsafe autocorrection')
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RubocopTodoCorrector
4
- VERSION = '0.18.3'
4
+ VERSION = '0.19.0'
5
5
  end
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
11
11
  spec.summary = 'Autocorrect offenses defined in .rubocop_todo.yml.'
12
12
  spec.homepage = 'https://github.com/r7kamura/rubocop_todo_corrector'
13
13
  spec.license = 'MIT'
14
- spec.required_ruby_version = '>= 3.1'
14
+ spec.required_ruby_version = '>= 3.3'
15
15
 
16
16
  spec.metadata['homepage_uri'] = spec.homepage
17
17
  spec.metadata['source_code_uri'] = spec.homepage
@@ -31,6 +31,7 @@ Gem::Specification.new do |spec|
31
31
 
32
32
  spec.add_dependency 'asciidoctor'
33
33
  spec.add_dependency 'bundler'
34
+ spec.add_dependency 'logger'
34
35
  spec.add_dependency 'thor'
35
36
  spec.add_dependency 'yard'
36
37
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop_todo_corrector
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.18.3
4
+ version: 0.19.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryo Nakamura
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2025-09-22 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: asciidoctor
@@ -38,6 +37,20 @@ dependencies:
38
37
  - - ">="
39
38
  - !ruby/object:Gem::Version
40
39
  version: '0'
40
+ - !ruby/object:Gem::Dependency
41
+ name: logger
42
+ requirement: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
47
+ type: :runtime
48
+ prerelease: false
49
+ version_requirements: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
41
54
  - !ruby/object:Gem::Dependency
42
55
  name: thor
43
56
  requirement: !ruby/object:Gem::Requirement
@@ -66,7 +79,6 @@ dependencies:
66
79
  - - ">="
67
80
  - !ruby/object:Gem::Version
68
81
  version: '0'
69
- description:
70
82
  email:
71
83
  - r7kamura@gmail.com
72
84
  executables:
@@ -116,7 +128,6 @@ metadata:
116
128
  source_code_uri: https://github.com/r7kamura/rubocop_todo_corrector
117
129
  changelog_uri: https://github.com/r7kamura/rubocop_todo_corrector/releases
118
130
  rubygems_mfa_required: 'true'
119
- post_install_message:
120
131
  rdoc_options: []
121
132
  require_paths:
122
133
  - lib
@@ -124,15 +135,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
124
135
  requirements:
125
136
  - - ">="
126
137
  - !ruby/object:Gem::Version
127
- version: '3.1'
138
+ version: '3.3'
128
139
  required_rubygems_version: !ruby/object:Gem::Requirement
129
140
  requirements:
130
141
  - - ">="
131
142
  - !ruby/object:Gem::Version
132
143
  version: '0'
133
144
  requirements: []
134
- rubygems_version: 3.3.27
135
- signing_key:
145
+ rubygems_version: 4.0.20
136
146
  specification_version: 4
137
147
  summary: Autocorrect offenses defined in .rubocop_todo.yml.
138
148
  test_files: []