From e24b5c41379f791fd468bd4cc01c7877b19cc674 Mon Sep 17 00:00:00 2001 From: Andrew Heard Date: Thu, 8 Aug 2024 18:14:40 -0400 Subject: [PATCH] Move SwiftFormat options to a config file (#208) --- .swiftformat | 14 ++++++++++++++ .../SwiftUnit/GULAppEnvironmentUtilTest.swift | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 .swiftformat diff --git a/.swiftformat b/.swiftformat new file mode 100644 index 0000000..7def2b7 --- /dev/null +++ b/.swiftformat @@ -0,0 +1,14 @@ +# Formatting Options - Mimic Google style +--indent 2 +--maxwidth 100 +--wrapparameters afterfirst + +# Disabled Rules + +# Too many of our swift files have simplistic examples. While technically +# it's correct to remove the unused argument labels, it makes our examples +# look wrong. +--disable unusedArguments + +# We prefer trailing braces. +--disable wrapMultilineStatementBraces diff --git a/GoogleUtilities/Tests/SwiftUnit/GULAppEnvironmentUtilTest.swift b/GoogleUtilities/Tests/SwiftUnit/GULAppEnvironmentUtilTest.swift index 26947be..7c2714a 100644 --- a/GoogleUtilities/Tests/SwiftUnit/GULAppEnvironmentUtilTest.swift +++ b/GoogleUtilities/Tests/SwiftUnit/GULAppEnvironmentUtilTest.swift @@ -14,8 +14,8 @@ * limitations under the License. */ -import XCTest @testable import GoogleUtilities +import XCTest class GULAppEnvironmentUtilTest: XCTestCase { func testIsAppExtension() throws {