Closed r7kamura closed 2 years ago
How to reproduce:
bundle exec ruby -Ilib -r rubocop_todo_corrector -e "RubocopTodoCorrector::CopDocumentParser.call(source_path: '/home/r7kamura/ghq/github.com/rubocop/rubocop/lib/rubocop/cop/style/redundant_sort.rb')"
[warn]: Unknown tag @safety in file `/home/r7kamura/ghq/github.com/rubocop/rubocop/lib/rubocop/cop/style/redundant_sort.rb` near line 79
I found this patch would erase this warning:
$ git diff
diff --git a/lib/rubocop_todo_corrector/cop_document_parser.rb b/lib/rubocop_todo_corrector/cop_document_parser.rb
index 21df1c2..ce41bd5 100644
--- a/lib/rubocop_todo_corrector/cop_document_parser.rb
+++ b/lib/rubocop_todo_corrector/cop_document_parser.rb
@@ -42,6 +42,7 @@ module RubocopTodoCorrector
# @return [YARD::CodeObjects::ClassObject]
def yard_class_object
@yard_class_object ||= begin
+ ::YARD::Tags::Library.define_tag('Cop Safety Information', :safety)
::YARD.parse(@source_path)
yardoc = ::YARD::Registry.all(:class).first
::YARD::Registry.clear
/home/r7kamura/ghq/github.com/r7kamura/rubocop_todo_corrector main
$ bundle exec ruby -Ilib -r rubocop_todo_corrector -e "RubocopTodoCorrector::CopDocumentParser.call(source_path: '/home/r7kamura/ghq/github.com/rubocop/rubocop/lib/rubocop/cop/style/redundant_sort.rb')"