Support for SwiftLint installed via Homebrew on Apple Silicon

This commit is contained in:
Gwendal Roué committed 2021-10-31 15:32:26 +01:00
1 parent 0f0c345ebb
commit b4f30784f4
4 files changed
+26 -6

No files matched your search

+5 -3
View File
@@ -1373,6 +1373,7 @@
56419A6C24A51601004967E1 /* Support.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Support.swift; sourceTree = "<group>"; };
56419A6D24A51601004967E1 /* DatabaseRegionObservationPublisherTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DatabaseRegionObservationPublisherTests.swift; sourceTree = "<group>"; };
56419A6E24A51601004967E1 /* ValueObservationPublisherTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ValueObservationPublisherTests.swift; sourceTree = "<group>"; };
5643676D272EDF2400C718C7 /* Scripts */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Scripts; sourceTree = "<group>"; };
564448821EF56B1B00DD2861 /* DatabaseAfterNextTransactionCommitTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DatabaseAfterNextTransactionCommitTests.swift; sourceTree = "<group>"; };
564A50C61BFF4B7F00B3A3A2 /* DatabaseCollationTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DatabaseCollationTests.swift; sourceTree = "<group>"; };
564CE43021AA901800652B19 /* ValueObserver.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ValueObserver.swift; sourceTree = "<group>"; };
@@ -2459,6 +2460,7 @@
DC10500F19C904DD00D8CA30 /* Tests */,
DC3773F419C8CBB3004FCF85 /* Products */,
564390D42414FC2C00BA61E6 /* Frameworks */,
5643676D272EDF2400C718C7 /* Scripts */,
);
indentWidth = 4;
sourceTree = "<group>";
@@ -2859,7 +2861,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "if which swiftlint >/dev/null; then\n swiftlint\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi\n";
shellScript = "${PROJECT_DIR}/Scripts/swiftlint.sh\n";
};
56EB54FA22C9115E00850069 /* Swiftlint */ = {
isa = PBXShellScriptBuildPhase;
@@ -2877,7 +2879,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "if which swiftlint >/dev/null; then\n swiftlint\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi\n";
shellScript = "${PROJECT_DIR}/Scripts/swiftlint.sh\n";
};
AAA4DCFA230F1E0600C74B15 /* Swiftlint */ = {
isa = PBXShellScriptBuildPhase;
@@ -2895,7 +2897,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "if which swiftlint >/dev/null; then\n swiftlint\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi\n";
shellScript = "${PROJECT_DIR}/Scripts/swiftlint.sh\n";
};
/* End PBXShellScriptBuildPhase section */
+4 -2
View File
@@ -875,6 +875,7 @@
56419A7F24A51614004967E1 /* Map.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Map.swift; sourceTree = "<group>"; };
56419A8024A51614004967E1 /* Inverted.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Inverted.swift; sourceTree = "<group>"; };
56419A8124A51614004967E1 /* PublisherExpectation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublisherExpectation.swift; sourceTree = "<group>"; };
5643676E272EDF3700C718C7 /* Scripts */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Scripts; sourceTree = "<group>"; };
564448821EF56B1B00DD2861 /* DatabaseAfterNextTransactionCommitTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DatabaseAfterNextTransactionCommitTests.swift; sourceTree = "<group>"; };
5644DE7E20F8D1D1001FFDDE /* DatabaseValueConversionErrorTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DatabaseValueConversionErrorTests.swift; sourceTree = "<group>"; };
564A50C61BFF4B7F00B3A3A2 /* DatabaseCollationTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DatabaseCollationTests.swift; sourceTree = "<group>"; };
@@ -1912,6 +1913,7 @@
DC37742D19C8CC90004FCF85 /* GRDB */,
F3BA7FED1CFB21F8003DC1BA /* GRDBCustomSQLite */,
DC10500F19C904DD00D8CA30 /* Tests */,
5643676E272EDF3700C718C7 /* Scripts */,
DC3773F419C8CBB3004FCF85 /* Products */,
);
indentWidth = 4;
@@ -2225,7 +2227,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "if which swiftlint >/dev/null; then\n swiftlint\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi\n";
shellScript = "${PROJECT_DIR}/Scripts/swiftlint.sh\n";
};
56EB54FD22C9119B00850069 /* Swiftlint */ = {
isa = PBXShellScriptBuildPhase;
@@ -2243,7 +2245,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "if which swiftlint >/dev/null; then\n swiftlint\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi\n";
shellScript = "${PROJECT_DIR}/Scripts/swiftlint.sh\n";
};
EED476F01CFD0B290026A4EC /* Copy .example configuration files (if no USER customizations exist) */ = {
isa = PBXShellScriptBuildPhase;
+14
View File
@@ -0,0 +1,14 @@
#!/bin/sh
set -e
# Support for SwiftLint installed via Homebrew on Apple Silicon
# https://github.com/realm/SwiftLint/issues/2992
if test -d "/opt/homebrew/bin/"; then
PATH="/opt/homebrew/bin/:${PATH}"
fi
if which swiftlint >/dev/null; then
swiftlint --config ${SRCROOT}/Scripts/swiftlint.yml
else
echo "warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint"
fi
+3 -1
View File
@@ -1,5 +1,5 @@
included:
- GRDB
- ../GRDB
disabled_rules:
- comment_spacing
@@ -26,6 +26,7 @@ disabled_rules:
opt_in_rules:
- anyobject_protocol
- array_init
- capture_variable
- closure_spacing
- collection_alignment
- contains_over_filter_count
@@ -33,6 +34,7 @@ opt_in_rules:
- contains_over_first_not_nil
- contains_over_range_nil_comparison
- convenience_type
- discouraged_assert
- empty_collection_literal
- empty_count
- empty_string