Switch SwiftFormat to lint mode and have it be lenient on local builds but fail on the CI

This commit is contained in:
Stefan Ceriu
2022-07-22 11:33:53 +03:00
committed by Stefan Ceriu
parent 65c35498bd
commit 922e037786
2 changed files with 18 additions and 21 deletions
+15 -10
View File
@@ -58,16 +58,6 @@ targets:
SWIFT_OBJC_BRIDGING_HEADER: ElementX/SupportingFiles/ElementX-Bridging-Header.h
preBuildScripts:
- name: 🧹 SwiftFormat
runOnlyWhenInstalling: false
shell: /bin/sh
script: |
export PATH="$PATH:/opt/homebrew/bin"
if which swiftformat >/dev/null; then
swiftformat $PROJECT_DIR
else
echo "warning: SwiftFormat not installed, download from https://github.com/nicklockwood/SwiftFormat"
fi
- name: 🛠 SwiftGen
runOnlyWhenInstalling: false
shell: /bin/sh
@@ -90,6 +80,21 @@ targets:
else
echo "warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint"
fi
- name: 🧹 SwiftFormat
runOnlyWhenInstalling: false
shell: /bin/sh
script: |
export PATH="$PATH:/opt/homebrew/bin"
if which swiftformat >/dev/null; then
if [ $CONFIGURATION = "Debug" ]; then
swiftformat --lint --lenient "$PROJECT_DIR"
else
swiftformat --lint "$PROJECT_DIR"
fi
else
echo "warning: SwiftFormat not installed, download from https://github.com/nicklockwood/SwiftFormat"
fi
dependencies:
- package: MatrixRustSDK