2022-10-11 00:52:32 +01:00
|
|
|
# typed: true
|
2021-03-30 04:38:45 +02:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
# from https://github.com/lsegal/yard/issues/484#issuecomment-442586899
|
|
|
|
class IgnoreDirectiveDocstringParser < YARD::DocstringParser
|
|
|
|
def parse_content(content)
|
|
|
|
super(content&.sub(/(\A(typed|.*rubocop)|TODO):.*/m, ""))
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
YARD::Docstring.default_parser = IgnoreDirectiveDocstringParser
|