From 57bd9e24fed5b930716518a24bba9c77bcf46aa7 Mon Sep 17 00:00:00 2001 From: heshamsalman Date: Wed, 12 Jul 2017 12:14:58 -0700 Subject: [PATCH] Updated script to pin SwiftLint version Summary: Issue fixed: #847 Pinned SwiftLint to 20.1 Closes https://github.com/Instagram/IGListKit/pull/854 Differential Revision: D5407797 Pulled By: rnystrom fbshipit-source-id: d092e9ff78853d6bb17e6b58d896ab1313e5d3c7 --- .../Examples-iOS/IGListKitExamples.xcodeproj/project.pbxproj | 2 +- .../IGListKitExamples.xcodeproj/project.pbxproj | 2 +- .../IGListKitExamples.xcodeproj/project.pbxproj | 2 +- scripts/lint.sh | 5 +++++ 4 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 scripts/lint.sh diff --git a/Examples/Examples-iOS/IGListKitExamples.xcodeproj/project.pbxproj b/Examples/Examples-iOS/IGListKitExamples.xcodeproj/project.pbxproj index 095feba93..b0e8d042e 100644 --- a/Examples/Examples-iOS/IGListKitExamples.xcodeproj/project.pbxproj +++ b/Examples/Examples-iOS/IGListKitExamples.xcodeproj/project.pbxproj @@ -797,7 +797,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "if which swiftlint >/dev/null; then\n swiftlint lint --config ../.swiftlint.yml\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi"; + shellScript = "sh ../../scripts/lint.sh"; }; DEB8B682C7C0C2DA4D507589 /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; diff --git a/Examples/Examples-macOS/IGListKitExamples.xcodeproj/project.pbxproj b/Examples/Examples-macOS/IGListKitExamples.xcodeproj/project.pbxproj index beef71ac2..257e7e908 100644 --- a/Examples/Examples-macOS/IGListKitExamples.xcodeproj/project.pbxproj +++ b/Examples/Examples-macOS/IGListKitExamples.xcodeproj/project.pbxproj @@ -269,7 +269,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "if which swiftlint >/dev/null; then\n swiftlint lint --config ../.swiftlint.yml\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi"; + shellScript = "sh ../../scripts/lint.sh"; }; /* End PBXShellScriptBuildPhase section */ diff --git a/Examples/Examples-tvOS/IGListKitExamples.xcodeproj/project.pbxproj b/Examples/Examples-tvOS/IGListKitExamples.xcodeproj/project.pbxproj index e5ea343eb..e6892dcfd 100644 --- a/Examples/Examples-tvOS/IGListKitExamples.xcodeproj/project.pbxproj +++ b/Examples/Examples-tvOS/IGListKitExamples.xcodeproj/project.pbxproj @@ -275,7 +275,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "if which swiftlint >/dev/null; then\n swiftlint lint --config ../.swiftlint.yml\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi"; + shellScript = "sh ../../scripts/lint.sh"; }; /* End PBXShellScriptBuildPhase section */ diff --git a/scripts/lint.sh b/scripts/lint.sh new file mode 100644 index 000000000..b684247db --- /dev/null +++ b/scripts/lint.sh @@ -0,0 +1,5 @@ +if which swiftlint >/dev/null && [ $(swiftlint version) == "0.20.1" ]; then + swiftlint lint --config ../.swiftlint.yml +else + echo "warning: SwiftLint not installed or incorrect version installed, download from https://github.com/realm/SwiftLint" +fi