diff --git a/.github/workflows/sanity.yml b/.github/workflows/sanity.yml index da290e6..6bcdf0e 100644 --- a/.github/workflows/sanity.yml +++ b/.github/workflows/sanity.yml @@ -16,6 +16,6 @@ jobs: - name: Install Dependencies run: | brew install mint - mint install nicklockwood/swiftformat@0.47.4 + mint install NickLockwood/SwiftFormat@0.47.4 --no-link - name: run script run: ./scripts/sanity.sh diff --git a/scripts/sanity.sh b/scripts/sanity.sh index 9b39a36..07074e1 100755 --- a/scripts/sanity.sh +++ b/scripts/sanity.sh @@ -27,7 +27,13 @@ function replace_acceptable_years() { printf "=> Checking format... " FIRST_OUT="$(git status --porcelain)" -swiftformat . > /dev/null 2>&1 +if [[ -n "${CI-""}" ]]; then + printf "(using v$(mint run NickLockwood/SwiftFormat@0.47.4 --version)) " + mint run NickLockwood/SwiftFormat@0.47.4 . > /dev/null 2>&1 +else + printf "(using v$(swiftformat --version)) " + swiftformat . > /dev/null 2>&1 +fi SECOND_OUT="$(git status --porcelain)" if [[ "$FIRST_OUT" != "$SECOND_OUT" ]]; then printf "\033[0;31mformatting issues!\033[0m\n"