rubocop_todo_corrector 0.18.0 → 0.18.2

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: efb93393a3a909e2af0629cf384bfb3c9c5a123ddef3e055c95a8622e8df367d
4
- data.tar.gz: 88bd969fe3b575e37f5f0903d3ba35b89eacbf363fa1f49e1ceec023279cd194
3
+ metadata.gz: dbc6e6028f4faa1f8c5a1d3a2d40f436f0819d9d4a1ad5c485d2384bb4c2d953
4
+ data.tar.gz: 8a84b5bfb2ae0ecd86fe956d928e5dcdcc0d1e4d73dcb8016ee7fe0d6af1a0c8
5
5
  SHA512:
6
- metadata.gz: 3a9ad177249f6d392edfa4b05c8e7c28cf577eb33a0eaa31a08f8033c872dbc30efc146e0a0aaf0aa6c4c1bdede0ce853dd95c13409dc0e4fe0e51ee472a95af
7
- data.tar.gz: 57177d4e1131d7cd97fd128aa17d4b156399a30f9d8f7ac763a022220fe8ee0809f1af16825888d60e77f8ab0826fc1e0a48cb1661ea07369e54dc3ae3176893
6
+ metadata.gz: 92c76d7d578cd02277cb9e3915dd7e3c59077d35bad1ff942e96c7550ae36734ff99e052df04c7a9acbf79e6d4e4489aa3d6bb0a9ad0def39227c5791bd79e0d
7
+ data.tar.gz: b93643732c9080dd5d5b11685de97a46b72af06ca558ba85a752fde005f7df02c4c5ffc444450ec6b7f888574f66d0bf180a8f85bb42c4c29ad652c873075dc4
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rubocop_todo_corrector (0.18.0)
4
+ rubocop_todo_corrector (0.18.2)
5
5
  asciidoctor
6
6
  bundler
7
7
  thor
@@ -64,7 +64,7 @@ GEM
64
64
  rubocop-rspec_rails (2.28.3)
65
65
  rubocop (~> 1.40)
66
66
  ruby-progressbar (1.13.0)
67
- thor (1.3.2)
67
+ thor (1.4.0)
68
68
  unicode-display_width (2.5.0)
69
69
  yard (0.9.37)
70
70
 
@@ -57,16 +57,11 @@ module RubocopTodoCorrector
57
57
  ::Kernel.system(
58
58
  { 'BUNDLE_GEMFILE' => @temporary_gemfile_path },
59
59
  [
60
- 'bundle exec rubocop --force-exclusion', autocorrect_option, *excluded_file_paths
60
+ 'bundle exec rubocop --force-exclusion', autocorrect_option, paths_option
61
61
  ].join(' ')
62
62
  )
63
63
  end
64
64
 
65
- # @return [String]
66
- def autocorrect_arguments
67
- ::Shellwords.shelljoin(excluded_file_paths)
68
- end
69
-
70
65
  # @return [String]
71
66
  def autocorrect_option
72
67
  if @only_safe
@@ -81,15 +76,19 @@ module RubocopTodoCorrector
81
76
  raise "#{rubocop_todo_pathname.to_s.inspect} does not exist." unless rubocop_todo_pathname.exist?
82
77
  end
83
78
 
84
- # @return [Array<String>]
79
+ # @return [Array<String>, nil]
85
80
  def excluded_file_paths
81
+ return @excluded_file_paths if defined?(@excluded_file_paths)
82
+
86
83
  cop_section = rubocop_todo_sections.grep(/^#{@cop_name}:/).first
87
84
  raise unless cop_section
88
85
 
89
- paths = ::YAML.safe_load(cop_section).dig(@cop_name, 'Exclude')
90
- raise unless paths
86
+ @excluded_file_paths = ::YAML.safe_load(cop_section).dig(@cop_name, 'Exclude')
87
+ end
91
88
 
92
- paths
89
+ # @return [String, nil]
90
+ def paths_option
91
+ ::Shellwords.shelljoin(excluded_file_paths) if excluded_file_paths
93
92
  end
94
93
 
95
94
  # @return [String]
@@ -104,7 +103,9 @@ module RubocopTodoCorrector
104
103
 
105
104
  # @return [String]
106
105
  def rubocop_todo_content_without_cop
107
- rubocop_todo_sections.grep_v(/^#{@cop_name}:$/).join("\n\n")
106
+ content = rubocop_todo_sections.grep_v(/^#{@cop_name}:$/).join("\n\n")
107
+ content += "\n" unless content.end_with?("\n")
108
+ content
108
109
  end
109
110
 
110
111
  # @return [Pathname]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RubocopTodoCorrector
4
- VERSION = '0.18.0'
4
+ VERSION = '0.18.2'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop_todo_corrector
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.18.0
4
+ version: 0.18.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryo Nakamura
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-07-17 00:00:00.000000000 Z
11
+ date: 2025-09-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciidoctor