Skip to content

Commit 5772f93

Browse files
authored
Add SwiftFormat and SwiftLint disable commands to generated code (#350)
This mirrors the behavior that exists in swift-protobuf. One can see examples of this and the pattern it directly mirrors in any `.pb.swift` file. The output from updated generator is demonstrated in the regenerated files within the repository itself. Fixes #349 Signed-off-by: Eddie Seay <[email protected]>
1 parent 7a67b10 commit 5772f93

File tree

5 files changed

+10
-0
lines changed

5 files changed

+10
-0
lines changed

Examples/ElizaSharedSources/GeneratedSources/connectrpc/eliza/v1/eliza.connect.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
// Code generated by protoc-gen-connect-swift. DO NOT EDIT.
2+
// swift-format-ignore-file
3+
// swiftlint:disable all
24
//
35
// Source: connectrpc/eliza/v1/eliza.proto
46
//

Plugins/ConnectPluginUtilities/Generator.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ open class Generator {
4444
/// - parameter descriptor: The file descriptor for which to generate code.
4545
open func printContent(for descriptor: SwiftProtobufPluginLibrary.FileDescriptor) {
4646
self.printLine("// Code generated by protoc-gen-connect-swift. DO NOT EDIT.")
47+
self.printLine("// swift-format-ignore-file")
48+
self.printLine("// swiftlint:disable all")
4749
self.printLine("//")
4850
self.printLine("// Source: \(descriptor.name)")
4951
self.printLine("//")

Tests/ConformanceClient/GeneratedSources/connectrpc/conformance/v1/service.connect.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
// Code generated by protoc-gen-connect-swift. DO NOT EDIT.
2+
// swift-format-ignore-file
3+
// swiftlint:disable all
24
//
35
// Source: connectrpc/conformance/v1/service.proto
46
//

Tests/UnitTests/ConnectLibraryTests/GeneratedSources/connectrpc/conformance/v1/service.connect.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
// Code generated by protoc-gen-connect-swift. DO NOT EDIT.
2+
// swift-format-ignore-file
3+
// swiftlint:disable all
24
//
35
// Source: connectrpc/conformance/v1/service.proto
46
//

Tests/UnitTests/ConnectLibraryTests/GeneratedSources/connectrpc/conformance/v1/service.mock.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
// Code generated by protoc-gen-connect-swift. DO NOT EDIT.
2+
// swift-format-ignore-file
3+
// swiftlint:disable all
24
//
35
// Source: connectrpc/conformance/v1/service.proto
46
//

0 commit comments

Comments
 (0)