Run SwiftFormat (non-lenient) separately on CI. (#167)

Make the lenient run into a post build step.
This commit is contained in:
Doug 2022-08-30 16:45:40 +01:00 committed by GitHub
parent 39be67cec6
commit 7c37d2f143
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 34 additions and 37 deletions

View File

@ -36,6 +36,10 @@ jobs:
run:
brew update && brew bundle && brew upgrade swiftformat
- name: SwiftFormat
run:
swiftformat --lint .
- name: Bundle install
run: |
bundle config path vendor/bundle

View File

@ -1768,11 +1768,11 @@
buildConfigurationList = B15427F8699AD5A5FC75C17E /* Build configuration list for PBXNativeTarget "ElementX" */;
buildPhases = (
A7130911BCB2DF3D249A1836 /* 🛠 SwiftGen */,
B35AB66424BB30087EEE408C /* 🧹 SwiftFormat */,
9797D588420FCBBC228A63C9 /* Sources */,
215E1D91B98672C856F559D0 /* Resources */,
EE878EAA342710DB973E0A87 /* Frameworks */,
98CA896D84BFD53B2554E891 /* ⚠️ SwiftLint */,
B35AB66424BB30087EEE408C /* 🧹 SwiftFormat */,
);
buildRules = (
);
@ -2073,7 +2073,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
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";
shellScript = "export PATH=\"$PATH:/opt/homebrew/bin\"\nif which swiftformat >/dev/null; then\n swiftformat --lint --lenient \"$PROJECT_DIR\"\nelse\n echo \"warning: SwiftFormat not installed, download from https://github.com/nicklockwood/SwiftFormat\"\nfi\n";
};
/* End PBXShellScriptBuildPhase section */

View File

@ -115,16 +115,6 @@
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D3DB351B7FBE0F49649171FC"
BuildableName = "IntegrationTests.xctest"
BlueprintName = "IntegrationTests"
ReferencedContainer = "container:ElementX.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<CommandLineArguments>
</CommandLineArguments>
<EnvironmentVariables>
@ -144,6 +134,15 @@
isEnabled = "YES">
</EnvironmentVariable>
</EnvironmentVariables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D3DB351B7FBE0F49649171FC"
BuildableName = "IntegrationTests.xctest"
BlueprintName = "IntegrationTests"
ReferencedContainer = "container:ElementX.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">

View File

@ -77,8 +77,9 @@
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<CommandLineArguments>
</CommandLineArguments>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "0E28CD62691FDBC63147D5E3"
@ -86,9 +87,7 @@
BlueprintName = "UITests"
ReferencedContainer = "container:ElementX.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<CommandLineArguments>
</CommandLineArguments>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">

View File

@ -99,8 +99,9 @@
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<CommandLineArguments>
</CommandLineArguments>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "32C23C8D224D46EFE62AFAD0"
@ -108,9 +109,7 @@
BlueprintName = "UnitTests"
ReferencedContainer = "container:ElementX.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<CommandLineArguments>
</CommandLineArguments>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">

View File

@ -70,21 +70,6 @@ targets:
echo "warning: SwiftGen not installed, download from https://github.com/SwiftGen/SwiftGen"
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
postBuildScripts:
- name: ⚠️ SwiftLint
runOnlyWhenInstalling: false
@ -96,6 +81,16 @@ 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
swiftformat --lint --lenient "$PROJECT_DIR"
else
echo "warning: SwiftFormat not installed, download from https://github.com/nicklockwood/SwiftFormat"
fi
dependencies:
- package: MatrixRustSDK

1
changelog.d/pr-167.build Normal file
View File

@ -0,0 +1 @@
Run SwiftFormat as a post-build script locally, with an additional pre-build step on CI.