rubocop_todo_corrector 0.6.0 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a16c0718e0411c212efc6aa1a070df5c0784c415b3ae25b47686c35d4a37f196
4
- data.tar.gz: 38c4affee6edb3e6569a64df3d4b410522de4fee23c7f3849bbf9b7ccb1e67d9
3
+ metadata.gz: 86fbfcf2dc8bc54f4a72ce5c802c55063ca925e55174bdcc56ca9194fb9bade1
4
+ data.tar.gz: 7e95e96cbdffea5a2e8706fc496218a8f00288255a7cd32015a55589922cd642
5
5
  SHA512:
6
- metadata.gz: a31400bdfed79ab2ed935347885b40bae95956dec916b42dfb001b09507443ed3275cb003402bd427f73bd401006783360916c8f2de20e2382d5dbed18f70720
7
- data.tar.gz: 8db623bd95d0f3c942df88e1ac720c296305c0f8b2b88371993906cc522253d1159a49c2bc8ac0e3c803c09d672804da908a2970b8d707f22d780ea81a291864
6
+ metadata.gz: b1baced0e45b00f3419ec85125d023737d1ca33af3ae642f175bcba37b275c517050f283974b63291ab432683a45fbb891f9a961ea17cc4fa86e825d9bf35654
7
+ data.tar.gz: 807219d3418b38e8383e40b557ccc93b1e685d6011c669407bab48364eabd3d3bd9f0efa35319b50ee7055e4af798f73b4d4b1ad09a76495bedcb5e9d04c2e84
data/CHANGELOG.md CHANGED
@@ -2,6 +2,24 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.8.0 - 2022-07-23
6
+
7
+ ### Added
8
+
9
+ - Add `clean` command.
10
+
11
+ ## 0.7.1 - 2022-05-28
12
+
13
+ ### Fixed
14
+
15
+ - Fix YARD unknown tag warning.
16
+
17
+ ## 0.7.0 - 2022-05-27
18
+
19
+ ### Added
20
+
21
+ - Support rubocop 1.30 .rubocop_todo.yml format.
22
+
5
23
  ## 0.6.0 - 2022-05-16
6
24
 
7
25
  ### Added
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rubocop_todo_corrector (0.6.0)
4
+ rubocop_todo_corrector (0.8.0)
5
5
  bundler
6
6
  thor
7
7
  yard
@@ -50,7 +50,7 @@ GEM
50
50
  thor (1.2.1)
51
51
  unicode-display_width (2.1.0)
52
52
  webrick (1.7.0)
53
- yard (0.9.27)
53
+ yard (0.9.28)
54
54
  webrick (~> 1.7.0)
55
55
 
56
56
  PLATFORMS
data/README.md CHANGED
@@ -25,6 +25,7 @@ gem install rubocop_todo_corrector
25
25
  $ rubocop_todo_corrector
26
26
  Commands:
27
27
  rubocop_todo_corrector bundle # Run `bundle install` to install RuboCop related gems.
28
+ rubocop_todo_corrector clean # Remove temporary files.
28
29
  rubocop_todo_corrector correct # Run `rubocop --auto-correct-all`.
29
30
  rubocop_todo_corrector describe --cop-name=COP_NAME # Output Markdown description for specified cop.
30
31
  rubocop_todo_corrector generate # Run `rubocop --auto-gen-config` to generate .rubocop_todo.yml.
@@ -43,6 +44,16 @@ Usage:
43
44
  Run `bundle install` to install RuboCop related gems.
44
45
  ```
45
46
 
47
+ ### Clean
48
+
49
+ ```console
50
+ $ rubocop_todo_corrector help clean
51
+ Usage:
52
+ rubocop_todo_corrector clean
53
+
54
+ Remove temporary files.
55
+ ```
56
+
46
57
  ### correct
47
58
 
48
59
  ```console
@@ -14,6 +14,13 @@ module RubocopTodoCorrector
14
14
  )
15
15
  end
16
16
 
17
+ desc 'clean', 'Remove temporary files.'
18
+ def clean
19
+ Commands::Clean.call(
20
+ temporary_gemfile_path: 'tmp/Gemfile_rubocop_todo_corrector.rb'
21
+ )
22
+ end
23
+
17
24
  desc 'correct', 'Run `rubocop --auto-correct(-all)`.'
18
25
  option(
19
26
  :only_safe,
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'fileutils'
4
+
5
+ module RubocopTodoCorrector
6
+ module Commands
7
+ class Clean
8
+ class << self
9
+ # @param [String] temporary_gemfile_path
10
+ def call(
11
+ temporary_gemfile_path:
12
+ )
13
+ new(
14
+ temporary_gemfile_path:
15
+ ).call
16
+ end
17
+ end
18
+
19
+ def initialize(
20
+ temporary_gemfile_path:
21
+ )
22
+ @temporary_gemfile_path = temporary_gemfile_path
23
+ end
24
+
25
+ def call
26
+ ::FileUtils.rm_f(
27
+ [
28
+ @temporary_gemfile_path,
29
+ "#{@temporary_gemfile_path}.lock"
30
+ ]
31
+ )
32
+ end
33
+ end
34
+ end
35
+ end
@@ -3,6 +3,7 @@
3
3
  module RubocopTodoCorrector
4
4
  module Commands
5
5
  autoload :Bundle, 'rubocop_todo_corrector/commands/bundle'
6
+ autoload :Clean, 'rubocop_todo_corrector/commands/clean'
6
7
  autoload :Correct, 'rubocop_todo_corrector/commands/correct'
7
8
  autoload :Describe, 'rubocop_todo_corrector/commands/describe'
8
9
  autoload :Generate, 'rubocop_todo_corrector/commands/generate'
@@ -42,6 +42,7 @@ module RubocopTodoCorrector
42
42
  # @return [YARD::CodeObjects::ClassObject]
43
43
  def yard_class_object
44
44
  @yard_class_object ||= begin
45
+ ::YARD::Tags::Library.define_tag('Cop Safety Information', :safety)
45
46
  ::YARD.parse(@source_path)
46
47
  yardoc = ::YARD::Registry.all(:class).first
47
48
  ::YARD::Registry.clear
@@ -29,7 +29,7 @@ module RubocopTodoCorrector
29
29
 
30
30
  # @return [Boolean]
31
31
  def auto_correctable
32
- safe_auto_correctable || unsafe_auto_corectable
32
+ safe_auto_correctable || unsafe_auto_correctable
33
33
  end
34
34
 
35
35
  # @return [String, nil]
@@ -46,13 +46,15 @@ module RubocopTodoCorrector
46
46
  end
47
47
 
48
48
  def safe_auto_correctable
49
- @content.include?('# Cop supports --auto-correct.') ||
50
- @content.include?('# This cop supports safe auto-correction')
49
+ @content.include?('# Cop supports --auto-correct.') || # Before rubocop 1.26
50
+ @content.include?('# This cop supports safe auto-correction') || # Before rubocop 1.30
51
+ @content.include?('# This cop supports safe autocorrection')
51
52
  end
52
53
 
53
- def unsafe_auto_corectable
54
+ def unsafe_auto_correctable
54
55
  @content.include?('# Cop supports --auto-correct-all') ||
55
- @content.include?('# This cop supports unsafe auto-correction')
56
+ @content.include?('# This cop supports unsafe auto-correction') ||
57
+ @content.include?('# This cop supports unsafe autocorrection')
56
58
  end
57
59
  end
58
60
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RubocopTodoCorrector
4
- VERSION = '0.6.0'
4
+ VERSION = '0.8.0'
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.6.0
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryo Nakamura
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-05-16 00:00:00.000000000 Z
11
+ date: 2022-07-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -75,6 +75,7 @@ files:
75
75
  - lib/rubocop_todo_corrector/cli.rb
76
76
  - lib/rubocop_todo_corrector/commands.rb
77
77
  - lib/rubocop_todo_corrector/commands/bundle.rb
78
+ - lib/rubocop_todo_corrector/commands/clean.rb
78
79
  - lib/rubocop_todo_corrector/commands/correct.rb
79
80
  - lib/rubocop_todo_corrector/commands/describe.rb
80
81
  - lib/rubocop_todo_corrector/commands/generate.rb