rubocop_todo_corrector 0.14.1 → 0.15.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/Gemfile.lock +2 -2
- data/README.md +1 -1
- data/lib/rubocop_todo_corrector/cop_document_parser.rb +0 -9
- data/lib/rubocop_todo_corrector/description_renderer.rb +20 -0
- data/lib/rubocop_todo_corrector/version.rb +1 -1
- data/rubocop_todo_corrector.gemspec +1 -1
- data/templates/description.md.erb +5 -9
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d47110b2a0a7d4d76187937d9f76ca9612c390470ad2d63cd5991cbad9dc4a3d
|
4
|
+
data.tar.gz: 513c4a0eeee07c9a593a4a2bc331c384da38ac729b8863bb557683416dc12f81
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e17be284491817e9208372a9d509cfdaad1f18d02b7d47f86a94043d8e9da9b9097357739ab7090573e026a820c6f7feaac7c00a17dea9be71bf5c00187a8e2a
|
7
|
+
data.tar.gz: 0d27d64fef45604c3d6f6891c1b47c78ff77cc681216509746fca02cbc3cc584d321111a46a29066b75e7d053c0a21134e75d319bb688b02fc4c060ba775d522
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rubocop_todo_corrector (0.
|
4
|
+
rubocop_todo_corrector (0.15.0)
|
5
5
|
asciidoctor
|
6
6
|
bundler
|
7
7
|
thor
|
@@ -10,7 +10,7 @@ PATH
|
|
10
10
|
GEM
|
11
11
|
remote: https://rubygems.org/
|
12
12
|
specs:
|
13
|
-
asciidoctor (2.0.
|
13
|
+
asciidoctor (2.0.18)
|
14
14
|
ast (2.4.2)
|
15
15
|
diff-lcs (1.5.0)
|
16
16
|
parallel (1.22.1)
|
data/README.md
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
[](https://github.com/r7kamura/rubocop_todo_corrector/actions/workflows/test.yml)
|
4
4
|
[](https://rubygems.org/gems/rubocop_todo_corrector)
|
5
5
|
|
6
|
-
|
6
|
+
Autocorrect offenses defined in `.rubocop_todo.yml`.
|
7
7
|
|
8
8
|
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.
|
9
9
|
|
@@ -1,6 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'asciidoctor'
|
4
3
|
require 'yard'
|
5
4
|
|
6
5
|
module RubocopTodoCorrector
|
@@ -38,14 +37,6 @@ module RubocopTodoCorrector
|
|
38
37
|
|
39
38
|
# @return [String]
|
40
39
|
def description
|
41
|
-
::Asciidoctor.convert(
|
42
|
-
docstring,
|
43
|
-
safe: :safe
|
44
|
-
)
|
45
|
-
end
|
46
|
-
|
47
|
-
# @return [String]
|
48
|
-
def docstring
|
49
40
|
yard_class_object.docstring
|
50
41
|
end
|
51
42
|
|
@@ -1,5 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'asciidoctor'
|
3
4
|
require 'erb'
|
4
5
|
require 'open3'
|
5
6
|
|
@@ -42,6 +43,25 @@ module RubocopTodoCorrector
|
|
42
43
|
|
43
44
|
private
|
44
45
|
|
46
|
+
# Convert AsciiDoc to HTML.
|
47
|
+
# @param [String] string
|
48
|
+
# @return [String]
|
49
|
+
def asciidoc(string)
|
50
|
+
::Asciidoctor.convert(
|
51
|
+
string,
|
52
|
+
safe: :safe
|
53
|
+
)
|
54
|
+
end
|
55
|
+
|
56
|
+
# Prepend quote marker to each line.
|
57
|
+
# @param [String] string
|
58
|
+
# @return [String]
|
59
|
+
def quote(string)
|
60
|
+
string.each_line.map do |line|
|
61
|
+
"> #{line}".strip
|
62
|
+
end.join("\n")
|
63
|
+
end
|
64
|
+
|
45
65
|
# @return [String]
|
46
66
|
def template_content
|
47
67
|
::File.read(TEMPLATE_PATH)
|
@@ -8,7 +8,7 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.authors = ['Ryo Nakamura']
|
9
9
|
spec.email = ['r7kamura@gmail.com']
|
10
10
|
|
11
|
-
spec.summary = '
|
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
14
|
spec.required_ruby_version = '>= 3.1'
|
@@ -1,21 +1,19 @@
|
|
1
|
-
|
1
|
+
Autocorrect `<%= @cop_name %>`
|
2
2
|
|
3
3
|
## Summary
|
4
4
|
|
5
|
-
|
5
|
+
Autocorrected [<%= @cop_name %>](<%= @cop_url %>).
|
6
6
|
|
7
7
|
## Details
|
8
8
|
|
9
9
|
### <%= @cop_name %>
|
10
10
|
|
11
|
-
|
12
|
-
<%= "> #{line}".strip %>
|
13
|
-
<% end -%>
|
11
|
+
<%= quote(asciidoc(@cop_document[:description])) %>
|
14
12
|
<% if @cop_document[:safety] -%>
|
15
13
|
>
|
16
14
|
> #### Safety
|
17
15
|
>
|
18
|
-
|
16
|
+
<%= quote(asciidoc(@cop_document[:safety][:text])) %>
|
19
17
|
<% end -%>
|
20
18
|
<% unless @cop_document[:examples].empty? -%>
|
21
19
|
>
|
@@ -27,9 +25,7 @@ Auto-corrected [<%= @cop_name %>](<%= @cop_url %>).
|
|
27
25
|
<% end -%>
|
28
26
|
>
|
29
27
|
> ```ruby
|
30
|
-
|
31
|
-
<%= "> #{line}".strip %>
|
32
|
-
<% end -%>
|
28
|
+
<%= quote(example[:text]) %>
|
33
29
|
> ```
|
34
30
|
<% end -%>
|
35
31
|
<% 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.
|
4
|
+
version: 0.15.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryo Nakamura
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-12-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: asciidoctor
|
@@ -66,7 +66,7 @@ dependencies:
|
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
|
-
description:
|
69
|
+
description:
|
70
70
|
email:
|
71
71
|
- r7kamura@gmail.com
|
72
72
|
executables:
|
@@ -115,7 +115,7 @@ metadata:
|
|
115
115
|
source_code_uri: https://github.com/r7kamura/rubocop_todo_corrector
|
116
116
|
changelog_uri: https://github.com/r7kamura/rubocop_todo_corrector/blob/main/CHANGELOG.md
|
117
117
|
rubygems_mfa_required: 'true'
|
118
|
-
post_install_message:
|
118
|
+
post_install_message:
|
119
119
|
rdoc_options: []
|
120
120
|
require_paths:
|
121
121
|
- lib
|
@@ -130,8 +130,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
130
130
|
- !ruby/object:Gem::Version
|
131
131
|
version: '0'
|
132
132
|
requirements: []
|
133
|
-
rubygems_version: 3.3.
|
134
|
-
signing_key:
|
133
|
+
rubygems_version: 3.3.26
|
134
|
+
signing_key:
|
135
135
|
specification_version: 4
|
136
|
-
summary:
|
136
|
+
summary: Autocorrect offenses defined in .rubocop_todo.yml.
|
137
137
|
test_files: []
|