From 91fc520a2e4e52efff98bb5139666eb6b94c6640 Mon Sep 17 00:00:00 2001 From: Doug Date: Wed, 3 Aug 2022 12:17:09 +0100 Subject: [PATCH] Run SwiftFormat as a prebuild script to fail early on CI. --- ElementX.xcodeproj/project.pbxproj | 2 +- .../xcshareddata/xcschemes/ElementX.xcscheme | 22 ++++++++-------- ElementX/SupportingFiles/target.yml | 26 +++++++++---------- changelog.d/pr-157.build | 1 + 4 files changed, 26 insertions(+), 25 deletions(-) create mode 100644 changelog.d/pr-157.build diff --git a/ElementX.xcodeproj/project.pbxproj b/ElementX.xcodeproj/project.pbxproj index bc222d9f7..dc8d85a94 100644 --- a/ElementX.xcodeproj/project.pbxproj +++ b/ElementX.xcodeproj/project.pbxproj @@ -1671,11 +1671,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 = ( ); diff --git a/ElementX.xcodeproj/xcshareddata/xcschemes/ElementX.xcscheme b/ElementX.xcodeproj/xcshareddata/xcschemes/ElementX.xcscheme index ea6774bb2..17973a92e 100644 --- a/ElementX.xcodeproj/xcshareddata/xcschemes/ElementX.xcscheme +++ b/ElementX.xcodeproj/xcshareddata/xcschemes/ElementX.xcscheme @@ -27,9 +27,18 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + shouldUseLaunchSchemeArgsEnv = "NO" codeCoverageEnabled = "YES" - onlyGenerateCoverageForSpecifiedTargets = "YES" - shouldUseLaunchSchemeArgsEnv = "NO"> + onlyGenerateCoverageForSpecifiedTargets = "YES"> + + + + @@ -52,15 +61,6 @@ - - - - diff --git a/ElementX/SupportingFiles/target.yml b/ElementX/SupportingFiles/target.yml index 903f41fdb..0257a320c 100644 --- a/ElementX/SupportingFiles/target.yml +++ b/ElementX/SupportingFiles/target.yml @@ -70,18 +70,6 @@ targets: else echo "warning: SwiftGen not installed, download from https://github.com/SwiftGen/SwiftGen" fi - - postBuildScripts: - - name: ⚠️ SwiftLint - runOnlyWhenInstalling: false - shell: /bin/sh - script: | - export PATH="$PATH:/opt/homebrew/bin" - if which swiftlint >/dev/null; then - swiftlint - else - echo "warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint" - fi - name: 🧹 SwiftFormat runOnlyWhenInstalling: false @@ -97,7 +85,19 @@ targets: else echo "warning: SwiftFormat not installed, download from https://github.com/nicklockwood/SwiftFormat" fi - + + postBuildScripts: + - name: ⚠️ SwiftLint + runOnlyWhenInstalling: false + shell: /bin/sh + script: | + export PATH="$PATH:/opt/homebrew/bin" + if which swiftlint >/dev/null; then + swiftlint + else + echo "warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint" + fi + dependencies: - package: MatrixRustSDK - package: DesignKit diff --git a/changelog.d/pr-157.build b/changelog.d/pr-157.build new file mode 100644 index 000000000..024056194 --- /dev/null +++ b/changelog.d/pr-157.build @@ -0,0 +1 @@ +Disable danger for external forks due to missing secret and run SwiftFormat as a pre-build step to fail early on CI.