From fcd5cb6e4574fe18b52bc564fbd46466108bba03 Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Mon, 22 Apr 2024 21:22:22 +0200 Subject: [PATCH] Fix CI. --- .github/workflows/tests.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ae5b32f068eb2a..ea972d758f7459 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -61,13 +61,19 @@ 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 "${public_apis[@]}" + echo "${rubocop_docs[@]}" + } | sort + exit 1 fi