Just started playing with swift-format - built a new version 0.50600.0 which passes the full test suite on my M1 MacBook Pro (with a default 5.6 toolchain) and in just two places, it will consistently move the functions opening brace to a new line (one place) and in an if statement (the other place) - it doesn't do it anywhere else in the code base and I must say I'm confused - is it a bug (can't file one as bugs.swift is gone and issues is not opened for swift-format yet) or a 'feature'. Using default out-of-the-box settings for formatting.
diff --git a/Sources/Generators/SchemaGenerators/Flatbuffers/FlatbuffersModelGenerator.swift b/Sources/Generators/SchemaGenerators/Flatbuffers/FlatbuffersModelGenerator.swift
index 29f1bb5..497a060 100644
--- a/Sources/Generators/SchemaGenerators/Flatbuffers/FlatbuffersModelGenerator.swift
+++ b/Sources/Generators/SchemaGenerators/Flatbuffers/FlatbuffersModelGenerator.swift
@@ -31,7 +31,8 @@ extension FlatbuffersGenerator {
// don't use optional null assignments for structs
if submirror.displayStyle == .struct
- || lowerCaseTypeDescriptionString == typeDescriptionString {
+ || lowerCaseTypeDescriptionString == typeDescriptionString
+ {
optionalString = "" // structs/tables are implicitly optional in flatbuffers
}
diff --git a/Sources/Generators/SchemaGenerators/Flatbuffers/FlatbuffersSwiftGenerator.swift b/Sources/Generators/SchemaGenerators/Flatbuffers/FlatbuffersSwiftGenerator.swift
index 9d2bbcf..0ec125e 100644
--- a/Sources/Generators/SchemaGenerators/Flatbuffers/FlatbuffersSwiftGenerator.swift
+++ b/Sources/Generators/SchemaGenerators/Flatbuffers/FlatbuffersSwiftGenerator.swift
@@ -64,7 +64,8 @@ extension FlatbuffersGenerator {
return result
}
- fileprivate func generateSwiftWrapper<T>(entityType: DataModelEntityType, modelType: T) -> String {
+ fileprivate func generateSwiftWrapper<T>(entityType: DataModelEntityType, modelType: T) -> String
+ {
var result = ""
let mirror = Mirror(reflecting: modelType)
Any ideas?