Use mint to run swift-format in sanity CI

This commit is contained in:
Adam Fowler
2021-04-24 18:09:34 +01:00
parent e86018f068
commit f852bc1d00
2 changed files with 8 additions and 2 deletions

View File

@@ -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

View File

@@ -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"