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
+3 -11
View File
@@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 52;
objectVersion = 51;
objects = {
/* Begin PBXBuildFile section */
@@ -842,13 +842,6 @@
path = Resources;
sourceTree = "<group>";
};
3180C73BA7B8F5F7447C99B0 /* React */ = {
isa = PBXGroup;
children = (
);
path = React;
sourceTree = "<group>";
};
328DD5DA1281F758B72006C7 /* Views */ = {
isa = PBXGroup;
children = (
@@ -1493,7 +1486,6 @@
E74CD7681375AD2EAA34D66B /* Authentication */,
4009BE2E791C16AC6EE39A7E /* BugReport */,
B53CA9BECD3F97805E1432D0 /* HomeScreen */,
3180C73BA7B8F5F7447C99B0 /* React */,
679E9837ECA8D6776079D16E /* RoomScreen */,
D958761758AA1110476DE6A3 /* SessionVerification */,
70B74A432C241E56A7ACE610 /* Settings */,
@@ -1659,12 +1651,12 @@
isa = PBXNativeTarget;
buildConfigurationList = B15427F8699AD5A5FC75C17E /* Build configuration list for PBXNativeTarget "ElementX" */;
buildPhases = (
B35AB66424BB30087EEE408C /* 🧹 SwiftFormat */,
A7130911BCB2DF3D249A1836 /* 🛠 SwiftGen */,
9797D588420FCBBC228A63C9 /* Sources */,
215E1D91B98672C856F559D0 /* Resources */,
EE878EAA342710DB973E0A87 /* Frameworks */,
98CA896D84BFD53B2554E891 /* ⚠️ SwiftLint */,
B35AB66424BB30087EEE408C /* 🧹 SwiftFormat */,
);
buildRules = (
);
@@ -1903,7 +1895,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "export PATH=\"$PATH:/opt/homebrew/bin\"\nif which swiftformat >/dev/null; then\n swiftformat $PROJECT_DIR\nelse\n echo \"warning: SwiftFormat not installed, download from https://github.com/nicklockwood/SwiftFormat\"\nfi\n";
shellScript = "export PATH=\"$PATH:/opt/homebrew/bin\"\nif which swiftformat >/dev/null; then\n if [ $CONFIGURATION = \"Debug\" ]; then \n swiftformat --lint --lenient \"$PROJECT_DIR\"\n else \n swiftformat --lint \"$PROJECT_DIR\"\n fi\nelse\n echo \"warning: SwiftFormat not installed, download from https://github.com/nicklockwood/SwiftFormat\"\nfi\n";
};
/* End PBXShellScriptBuildPhase section */
+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