rubocop_todo_corrector 0.2.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -1
- data/CHANGELOG.md +18 -0
- data/Gemfile.lock +2 -1
- data/README.md +1 -1
- data/lib/rubocop_todo_corrector/bundle_installer.rb +2 -2
- data/lib/rubocop_todo_corrector/cli.rb +2 -2
- data/lib/rubocop_todo_corrector/commands/bundle.rb +6 -6
- data/lib/rubocop_todo_corrector/commands/correct.rb +1 -1
- data/lib/rubocop_todo_corrector/commands/describe.rb +4 -4
- data/lib/rubocop_todo_corrector/commands/generate.rb +2 -2
- data/lib/rubocop_todo_corrector/commands/pick.rb +4 -4
- data/lib/rubocop_todo_corrector/commands/remove.rb +2 -2
- data/lib/rubocop_todo_corrector/cop_document_parser.rb +1 -1
- data/lib/rubocop_todo_corrector/cop_source_detector.rb +2 -2
- data/lib/rubocop_todo_corrector/description_renderer.rb +3 -3
- data/lib/rubocop_todo_corrector/gem_names_detector.rb +1 -1
- data/lib/rubocop_todo_corrector/gem_version_detector.rb +2 -2
- data/lib/rubocop_todo_corrector/rubocop_todo_parser.rb +3 -3
- data/lib/rubocop_todo_corrector/rubocop_todo_section_parser.rb +3 -3
- data/lib/rubocop_todo_corrector/version.rb +1 -1
- data/rubocop_todo_corrector.gemspec +1 -1
- data/templates/description.md.erb +2 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0f41cc52c87afb8d1971ed4dbf006acd3471c42183e3c9947e588870a6bff7f3
|
4
|
+
data.tar.gz: dba2c971d07471a2b2da8b76eaf6ae1b8a27cde13698a116a97c7edfab2cdeb6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 455f57a51dbd813148f3fde5d6c00f813e0edc47e2d5644b53efbe2bd3dda354fc4b6c52e952ca33b214309dc97ffe33a47f20fb5137759b224dcb4743fd11f5
|
7
|
+
data.tar.gz: 5d47b50b46c2fb7d79488ba0ef66bef0050483bb9c82ae346159ae69ba6b6e7145e2520658e41a914996e9d6bb6a17e4f125b1ce758c385326305cb8d6f8f2df
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,24 @@
|
|
2
2
|
|
3
3
|
## Unreleased
|
4
4
|
|
5
|
+
## 0.5.0 - 2022-05-16
|
6
|
+
|
7
|
+
### Changed
|
8
|
+
|
9
|
+
- Change required ruby version from 3.0 to 3.1.
|
10
|
+
|
11
|
+
## 0.4.0 - 2022-05-16
|
12
|
+
|
13
|
+
### Fixed
|
14
|
+
|
15
|
+
- Fix misspell: `occured` -> `occurred`.
|
16
|
+
|
17
|
+
## 0.3.0 - 2022-05-15
|
18
|
+
|
19
|
+
### Changed
|
20
|
+
|
21
|
+
- Change `describe` output so that commit-message-ready text is described.
|
22
|
+
|
5
23
|
## 0.2.0 - 2022-05-15
|
6
24
|
|
7
25
|
### Added
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -86,7 +86,7 @@ Usage:
|
|
86
86
|
Options:
|
87
87
|
[--mode=MODE]
|
88
88
|
# Default: random
|
89
|
-
# Possible values: first, last,
|
89
|
+
# Possible values: first, last, least_occurred, most_occurred, random
|
90
90
|
|
91
91
|
Output an auto-correctable Cop from .rubocop_todo.yml.
|
92
92
|
```
|
@@ -13,9 +13,9 @@ module RubocopTodoCorrector
|
|
13
13
|
temporary_gemfile_path:
|
14
14
|
)
|
15
15
|
new(
|
16
|
-
rubocop_configuration_path
|
17
|
-
gemfile_lock_path
|
18
|
-
temporary_gemfile_path:
|
16
|
+
rubocop_configuration_path:,
|
17
|
+
gemfile_lock_path:,
|
18
|
+
temporary_gemfile_path:
|
19
19
|
).call
|
20
20
|
end
|
21
21
|
end
|
@@ -32,7 +32,7 @@ module RubocopTodoCorrector
|
|
32
32
|
|
33
33
|
def call
|
34
34
|
BundleInstaller.call(
|
35
|
-
gem_specifications
|
35
|
+
gem_specifications:,
|
36
36
|
temporary_gemfile_path: @temporary_gemfile_path
|
37
37
|
)
|
38
38
|
end
|
@@ -51,9 +51,9 @@ module RubocopTodoCorrector
|
|
51
51
|
def gem_specifications
|
52
52
|
gem_names.map do |gem_name|
|
53
53
|
{
|
54
|
-
gem_name
|
54
|
+
gem_name:,
|
55
55
|
gem_version: GemVersionDetector.call(
|
56
|
-
gem_name
|
56
|
+
gem_name:,
|
57
57
|
gemfile_lock_path: @gemfile_lock_path
|
58
58
|
)
|
59
59
|
}
|
@@ -11,8 +11,8 @@ module RubocopTodoCorrector
|
|
11
11
|
temporary_gemfile_path:
|
12
12
|
)
|
13
13
|
new(
|
14
|
-
cop_name
|
15
|
-
temporary_gemfile_path:
|
14
|
+
cop_name:,
|
15
|
+
temporary_gemfile_path:
|
16
16
|
).call
|
17
17
|
end
|
18
18
|
end
|
@@ -36,9 +36,9 @@ module RubocopTodoCorrector
|
|
36
36
|
return unless cop_document
|
37
37
|
|
38
38
|
description = DescriptionRenderer.call(
|
39
|
-
cop_document
|
39
|
+
cop_document:,
|
40
40
|
cop_name: @cop_name,
|
41
|
-
cop_source_path:
|
41
|
+
cop_source_path:
|
42
42
|
)
|
43
43
|
::Kernel.puts(description)
|
44
44
|
end
|
@@ -13,8 +13,8 @@ module RubocopTodoCorrector
|
|
13
13
|
rubocop_todo_path:
|
14
14
|
)
|
15
15
|
new(
|
16
|
-
mode
|
17
|
-
rubocop_todo_path:
|
16
|
+
mode:,
|
17
|
+
rubocop_todo_path:
|
18
18
|
).call
|
19
19
|
end
|
20
20
|
end
|
@@ -57,11 +57,11 @@ module RubocopTodoCorrector
|
|
57
57
|
auto_correctable_cops.first
|
58
58
|
when 'last'
|
59
59
|
auto_correctable_cops.last
|
60
|
-
when '
|
60
|
+
when 'least_occurred'
|
61
61
|
auto_correctable_cops.min_by do |cop|
|
62
62
|
cop[:offenses_count]
|
63
63
|
end
|
64
|
-
when '
|
64
|
+
when 'most_occurred'
|
65
65
|
auto_correctable_cops.max_by do |cop|
|
66
66
|
cop[:offenses_count]
|
67
67
|
end
|
@@ -8,7 +8,7 @@ module RubocopTodoCorrector
|
|
8
8
|
# @param [String] rubocop_configuration_path
|
9
9
|
# @return [Array<String>]
|
10
10
|
def call(rubocop_configuration_path:)
|
11
|
-
new(rubocop_configuration_path:
|
11
|
+
new(rubocop_configuration_path:).call
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
@@ -16,7 +16,7 @@ module RubocopTodoCorrector
|
|
16
16
|
# @param [String] content
|
17
17
|
def call(content:)
|
18
18
|
new(
|
19
|
-
content:
|
19
|
+
content:
|
20
20
|
).call
|
21
21
|
end
|
22
22
|
end
|
@@ -28,8 +28,8 @@ module RubocopTodoCorrector
|
|
28
28
|
# @return [Hash]
|
29
29
|
def call
|
30
30
|
{
|
31
|
-
cops
|
32
|
-
previous_rubocop_command:
|
31
|
+
cops:,
|
32
|
+
previous_rubocop_command:
|
33
33
|
}
|
34
34
|
end
|
35
35
|
|
@@ -6,7 +6,7 @@ module RubocopTodoCorrector
|
|
6
6
|
# @param [String] content
|
7
7
|
def call(content:)
|
8
8
|
new(
|
9
|
-
content:
|
9
|
+
content:
|
10
10
|
).call
|
11
11
|
end
|
12
12
|
end
|
@@ -19,8 +19,8 @@ module RubocopTodoCorrector
|
|
19
19
|
def call
|
20
20
|
{
|
21
21
|
auto_correctable: auto_correctable?,
|
22
|
-
name
|
23
|
-
offenses_count:
|
22
|
+
name:,
|
23
|
+
offenses_count:
|
24
24
|
}
|
25
25
|
end
|
26
26
|
|
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
|
|
11
11
|
spec.summary = 'Auto-correct 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.
|
14
|
+
spec.required_ruby_version = '>= 3.1'
|
15
15
|
|
16
16
|
spec.metadata['homepage_uri'] = spec.homepage
|
17
17
|
spec.metadata['source_code_uri'] = spec.homepage
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubocop_todo_corrector
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryo Nakamura
|
@@ -106,7 +106,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
106
106
|
requirements:
|
107
107
|
- - ">="
|
108
108
|
- !ruby/object:Gem::Version
|
109
|
-
version: '3.
|
109
|
+
version: '3.1'
|
110
110
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
111
111
|
requirements:
|
112
112
|
- - ">="
|