diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 88903a17a4..4d5a5ed321 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -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 diff --git a/Library/Homebrew/.yardopts b/Library/Homebrew/.yardopts index ef2b4836c7..f9ca1591d5 100644 --- a/Library/Homebrew/.yardopts +++ b/Library/Homebrew/.yardopts @@ -2,6 +2,7 @@ --main README.md --markup markdown --no-private +--plugin sorbet --load yard/ignore_directives.rb --template-path yard/templates --exclude test/ diff --git a/Library/Homebrew/utils/inreplace.rb b/Library/Homebrew/utils/inreplace.rb index 9763760258..50ff78f80b 100644 --- a/Library/Homebrew/utils/inreplace.rb +++ b/Library/Homebrew/utils/inreplace.rb @@ -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: - #
inreplace "somefile.cfg", /look[for]what?/, "replace by #{bin}/tool"
+ # @example `inreplace` supports regular expressions: + # inreplace "somefile.cfg", /look[for]what?/, "replace by #{bin}/tool" # - # `inreplace` supports blocks: - #
inreplace "Makefile" do |s|
-    #   s.gsub! "/usr/local", HOMEBREW_PREFIX.to_s
-    # end
-    # 
+ # @example `inreplace` supports blocks: + # inreplace "Makefile" do |s| + # s.gsub! "/usr/local", HOMEBREW_PREFIX.to_s + # end # # @see StringInreplaceExtension # @api public diff --git a/Library/Homebrew/yard/templates/default/docstring/html/setup.rb b/Library/Homebrew/yard/templates/default/docstring/html/setup.rb index 6d07ea8198..27272f9ff6 100644 --- a/Library/Homebrew/yard/templates/default/docstring/html/setup.rb +++ b/Library/Homebrew/yard/templates/default/docstring/html/setup.rb @@ -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