diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ae5b32f068eb2a..2f30fb974ec84d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -61,13 +61,14 @@ jobs: - name: Check RuboCop filepaths working-directory: ${{ steps.set-up-homebrew.outputs.repository-path }}/Library/Homebrew run: | - public_apis=$(git grep -l "@api public" -- :^sorbet/ :^vendor/ | wc -l | tr -d ' ') - rubocop_docs=$(yq '.Style/Documentation.Include' .rubocop.yml | wc -l | tr -d ' ') - if [[ public_apis -ne rubocop_docs ]] + public_apis=$(git grep -l "@api public" -- :^sorbet/ :^vendor/ | sort) + rubocop_docs=$(yq '.Style/Documentation.Include[]' .rubocop.yml | sort) + if [[ "${public_apis[*]}" != "${rubocop_docs[*]}" ]] then - echo "All public Homebrew APIs should be included in the Style/Documentation RuboCop." - echo "There were ${public_apis} '@api public' lines but ${rubocop_docs} filepaths for the 'Style/Documentation' RuboCop." - echo "Add or remove the filepaths from Library/Homebrew/.rubocop.yml as appropriate." + echo 'All public Homebrew APIs should be included in the `Style/Documentation` RuboCop.' + echo 'Add/remove the following paths from `Library/Homebrew/.rubocop.yml` as appropriate:' + echo "${public_apis[@]}" "${rubocop_docs[@]}" | tr ' ' '\n' | sort | uniq -u + exit 1 fi diff --git a/Library/Homebrew/.rubocop.yml b/Library/Homebrew/.rubocop.yml index c14a7bc83e0150..9e756f5fb6782b 100644 --- a/Library/Homebrew/.rubocop.yml +++ b/Library/Homebrew/.rubocop.yml @@ -64,6 +64,7 @@ Style/Documentation: - utils/shebang.rb - utils/string_inreplace_extension.rb - version.rb + - tap.rb Style/DocumentationMethod: Include: diff --git a/Library/Homebrew/cask/cask.rb b/Library/Homebrew/cask/cask.rb index c2d581aaa2d779..7f0d0f2cacd8b4 100644 --- a/Library/Homebrew/cask/cask.rb +++ b/Library/Homebrew/cask/cask.rb @@ -22,7 +22,7 @@ class Cask # The token of this {Cask}. # - # @api public + # @api internal attr_reader :token # The configuration of this {Cask}. @@ -136,7 +136,7 @@ def timestamped_versions(caskroom_path: self.caskroom_path) # The fully-qualified token of this {Cask}. # - # @api public + # @api internal def full_token return token if tap.nil? return token if tap.core_cask_tap? @@ -327,7 +327,7 @@ def populate_from_api!(json_cask) # Alias for {#token}. # - # @api public + # @api internal def to_s = token def inspect