Skip to content

Commit

Permalink
Update CI swift format version
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-fowler committed Apr 11, 2024
1 parent 7afaaf5 commit 34afeb4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,5 @@ jobs:
- name: Install Dependencies
run: |
brew install mint
mint install nicklockwood/swiftformat@0.47.13 --no-link
- name: run script
run: ./scripts/validate.sh
8 changes: 4 additions & 4 deletions scripts/validate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
##
##===----------------------------------------------------------------------===##

SWIFT_VERSION=5.1
SWIFT_FORMAT_VERSION=0.51.15

set -eu
here="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
Expand All @@ -22,14 +22,14 @@ which swiftformat > /dev/null 2>&1 || (echo "swiftformat not installed. You can

function replace_acceptable_years() {
# this needs to replace all acceptable forms with 'YEARS'
sed -e 's/20[12][78901]-20[12][8901]/YEARS/' -e 's/20[12][8901]/YEARS/' -e '/^#!/ d'
sed -e 's/20[12][7890123456]-20[12][8901234567]/YEARS/' -e 's/20[12][8901234567]/YEARS/' -e '/^#!/ d'
}

printf "=> Checking format... "
FIRST_OUT="$(git status --porcelain)"
if [[ -n "${CI-""}" ]]; then
printf "(using v$(mint run NickLockwood/SwiftFormat@0.47.13 --version)) "
mint run NickLockwood/SwiftFormat@0.47.13 . > /dev/null 2>&1
printf "(using v$(mint run NickLockwood/SwiftFormat@$SWIFT_FORMAT_VERSION --version)) "
mint run NickLockwood/SwiftFormat@$SWIFT_FORMAT_VERSION . > /dev/null 2>&1
else
printf "(using v$(swiftformat --version)) "
swiftformat . > /dev/null 2>&1
Expand Down

0 comments on commit 34afeb4

Please sign in to comment.