Minor YARD improvements

This commit is contained in:
Douglas Eichelberger 2023-04-05 10:06:45 -07:00
parent 61efc7076d
commit 200b5cad6a
4 changed files with 13 additions and 9 deletions

View File

@ -64,4 +64,4 @@ jobs:
- name: Process rubydoc comments
working-directory: ${{ steps.set-up-homebrew.outputs.repository-path }}/Library/Homebrew
run: bundle exec yard doc --plugin sorbet --no-output --fail-on-warning
run: bundle exec yard doc --no-output --fail-on-warning

View File

@ -2,6 +2,7 @@
--main README.md
--markup markdown
--no-private
--plugin sorbet
--load yard/ignore_directives.rb
--template-path yard/templates
--exclude test/

View File

@ -29,14 +29,13 @@ module Utils
# defined by the formula, as only `HOMEBREW_PREFIX` is available
# in the {DATAPatch embedded patch}.
#
# `inreplace` supports regular expressions:
# <pre>inreplace "somefile.cfg", /look[for]what?/, "replace by #{bin}/tool"</pre>
# @example `inreplace` supports regular expressions:
# inreplace "somefile.cfg", /look[for]what?/, "replace by #{bin}/tool"
#
# `inreplace` supports blocks:
# <pre>inreplace "Makefile" do |s|
# s.gsub! "/usr/local", HOMEBREW_PREFIX.to_s
# end
# </pre>
# @example `inreplace` supports blocks:
# inreplace "Makefile" do |s|
# s.gsub! "/usr/local", HOMEBREW_PREFIX.to_s
# end
#
# @see StringInreplaceExtension
# @api public

View File

@ -1,7 +1,10 @@
# typed: false
# typed: true
# frozen_string_literal: true
def init
# `sorbet` is available transitively through the `yard-sorbet` plugin, but we're
# outside of the standalone sorbet config, so `checked` is enabled by default
T.bind(self, YARD::Templates::Template, checked: false)
super
return if sections.empty?
@ -10,5 +13,6 @@ def init
end
def internal
T.bind(self, YARD::Templates::Template, checked: false)
erb(:internal) if object.has_tag?(:api) && object.tag(:api).text == "internal"
end