diff --git a/.github/workflows/release-alpha.yml b/.github/workflows/release-alpha.yml index 1b5827831..294a7bd85 100644 --- a/.github/workflows/release-alpha.yml +++ b/.github/workflows/release-alpha.yml @@ -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 diff --git a/ElementX.xcodeproj/project.pbxproj b/ElementX.xcodeproj/project.pbxproj index 8effa1175..beda3b139 100644 --- a/ElementX.xcodeproj/project.pbxproj +++ b/ElementX.xcodeproj/project.pbxproj @@ -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 */ diff --git a/ElementX.xcodeproj/xcshareddata/xcschemes/IntegrationTests.xcscheme b/ElementX.xcodeproj/xcshareddata/xcschemes/IntegrationTests.xcscheme index fc614d259..8c8634d86 100644 --- a/ElementX.xcodeproj/xcshareddata/xcschemes/IntegrationTests.xcscheme +++ b/ElementX.xcodeproj/xcshareddata/xcschemes/IntegrationTests.xcscheme @@ -115,16 +115,6 @@ savedToolIdentifier = "" useCustomWorkingDirectory = "NO" debugDocumentVersioning = "YES"> - - - - @@ -144,6 +134,15 @@ isEnabled = "YES"> + + + + diff --git a/ElementX.xcodeproj/xcshareddata/xcschemes/UITests.xcscheme b/ElementX.xcodeproj/xcshareddata/xcschemes/UITests.xcscheme index f475d7ac6..7920df905 100644 --- a/ElementX.xcodeproj/xcshareddata/xcschemes/UITests.xcscheme +++ b/ElementX.xcodeproj/xcshareddata/xcschemes/UITests.xcscheme @@ -77,8 +77,9 @@ savedToolIdentifier = "" useCustomWorkingDirectory = "NO" debugDocumentVersioning = "YES"> - + + + - - - + diff --git a/ElementX.xcodeproj/xcshareddata/xcschemes/UnitTests.xcscheme b/ElementX.xcodeproj/xcshareddata/xcschemes/UnitTests.xcscheme index a226fa630..ef9d99906 100644 --- a/ElementX.xcodeproj/xcshareddata/xcschemes/UnitTests.xcscheme +++ b/ElementX.xcodeproj/xcshareddata/xcschemes/UnitTests.xcscheme @@ -99,8 +99,9 @@ savedToolIdentifier = "" useCustomWorkingDirectory = "NO" debugDocumentVersioning = "YES"> - + + + - - - + diff --git a/ElementX/SupportingFiles/target.yml b/ElementX/SupportingFiles/target.yml index a12822f1f..4d5e6a891 100644 --- a/ElementX/SupportingFiles/target.yml +++ b/ElementX/SupportingFiles/target.yml @@ -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 diff --git a/changelog.d/pr-167.build b/changelog.d/pr-167.build new file mode 100644 index 000000000..a40506be0 --- /dev/null +++ b/changelog.d/pr-167.build @@ -0,0 +1 @@ +Run SwiftFormat as a post-build script locally, with an additional pre-build step on CI. \ No newline at end of file