From 7a35d08039dd8a2170ae20c86ae20e6f1e0bd460 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Mon, 23 Jun 2025 19:57:00 +0100 Subject: [PATCH 1/2] .swift-format: Enable `ReturnVoidInsteadOfEmptyTuple` --- .swift-format | 3 ++- Sources/swift-format/Frontend/FormatFrontend.swift | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.swift-format b/.swift-format index 41a022f26..c258291d3 100644 --- a/.swift-format +++ b/.swift-format @@ -13,6 +13,7 @@ "NoBlockComments": false, "OrderedImports": true, "UseLetInEveryBoundCaseVariable": false, - "UseSynthesizedInitializer": false + "UseSynthesizedInitializer": false, + "ReturnVoidInsteadOfEmptyTuple": true, } } diff --git a/Sources/swift-format/Frontend/FormatFrontend.swift b/Sources/swift-format/Frontend/FormatFrontend.swift index a205b6405..0e8fca9d2 100644 --- a/Sources/swift-format/Frontend/FormatFrontend.swift +++ b/Sources/swift-format/Frontend/FormatFrontend.swift @@ -40,7 +40,7 @@ class FormatFrontend: Frontend { return } - let diagnosticHandler: (SwiftDiagnostics.Diagnostic, SourceLocation) -> () = { + let diagnosticHandler: (SwiftDiagnostics.Diagnostic, SourceLocation) -> Void = { (diagnostic, location) in guard !self.lintFormatOptions.ignoreUnparsableFiles else { // No diagnostics should be emitted in this mode. From 9feb350738e2b282435e606049d6f2b62ffb8c3e Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Mon, 23 Jun 2025 19:57:40 +0100 Subject: [PATCH 2/2] .swift-format: Enable `NoVoidReturnOnFunctionSignature` --- .swift-format | 1 + 1 file changed, 1 insertion(+) diff --git a/.swift-format b/.swift-format index c258291d3..176687e28 100644 --- a/.swift-format +++ b/.swift-format @@ -15,5 +15,6 @@ "UseLetInEveryBoundCaseVariable": false, "UseSynthesizedInitializer": false, "ReturnVoidInsteadOfEmptyTuple": true, + "NoVoidReturnOnFunctionSignature": true, } }