Use mint to run swift-format in sanity CI
This commit is contained in:
2
.github/workflows/sanity.yml
vendored
2
.github/workflows/sanity.yml
vendored
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user