[Swift] Adds a format file and reformats the swift project (#6250)

* Formats files & adds licence

* Revert arrays

* Keeps array indentation as is

* Adds licence to code formatter

* Updates code generators
This commit is contained in:
mustiikhalil
2020-11-16 19:52:38 +03:00
committed by GitHub
parent 6764f25d91
commit 537212afee
39 changed files with 4975 additions and 4376 deletions

View File

@@ -47,7 +47,7 @@ class SwiftGenerator : public BaseGenerator {
const std::string &file_name)
: BaseGenerator(parser, path, file_name, "", "_", "swift") {
namespace_depth = 0;
code_.SetPadding(" ");
code_.SetPadding(" ");
static const char *const keywords[] = {
"associatedtype",
"class",
@@ -137,7 +137,8 @@ class SwiftGenerator : public BaseGenerator {
code_.SetValue("ACCESS", "_accessor");
code_.SetValue("TABLEOFFSET", "VTOFFSET");
code_ += "// " + std::string(FlatBuffersGeneratedWarning());
code_ += "// swiftlint:disable all\n";
code_ += "// swiftlint:disable all";
code_ += "// swiftformat:disable all\n";
code_ += "import FlatBuffers\n";
// Generate code for all the enum declarations.