better format

motivation: adjust format to xcode format

changes:
* update .swiftformat no-indent setting and run formatter
* update test generation script to match correct format
This commit is contained in:
tomer doron 2019-12-17 11:02:01 -08:00 committed by Konrad `ktoso` Malawski
parent 49431459f9
commit 998de4b2cf
5 changed files with 13 additions and 12 deletions

2
.gitignore vendored
View File

@ -5,4 +5,4 @@
.xcode .xcode
.SourceKitten .SourceKitten
*.orig *.orig
.swiftpm .swiftpm

View File

@ -8,5 +8,6 @@
--patternlet inline --patternlet inline
--stripunusedargs unnamed-only --stripunusedargs unnamed-only
--comments ignore --comments ignore
--ifdef no-indent
# rules # rules

View File

@ -27,9 +27,9 @@
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS) #if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
import Darwin import Darwin
#else #else
import Glibc import Glibc
#endif #endif
/// A threading lock based on `libpthread` instead of `libdispatch`. /// A threading lock based on `libpthread` instead of `libdispatch`.

View File

@ -23,10 +23,10 @@ import XCTest
/// ///
#if os(Linux) || os(FreeBSD) #if os(Linux) || os(FreeBSD)
@testable import MetricsTests @testable import MetricsTests
XCTMain([ XCTMain([
testCase(MetricsExtensionsTests.allTests), testCase(MetricsExtensionsTests.allTests),
testCase(MetricsTests.allTests), testCase(MetricsTests.allTests),
]) ])
#endif #endif

View File

@ -96,10 +96,10 @@ def createLinuxMain(testsDirectory, allTestSubDirectories, files)
file.write "#if os(Linux) || os(FreeBSD)\n" file.write "#if os(Linux) || os(FreeBSD)\n"
for testSubDirectory in allTestSubDirectories.sort { |x, y| x <=> y } for testSubDirectory in allTestSubDirectories.sort { |x, y| x <=> y }
file.write ' @testable import ' + testSubDirectory + "\n" file.write '@testable import ' + testSubDirectory + "\n"
end end
file.write "\n" file.write "\n"
file.write " XCTMain([\n" file.write "XCTMain([\n"
testCases = [] testCases = []
for classes in files for classes in files
@ -109,9 +109,9 @@ def createLinuxMain(testsDirectory, allTestSubDirectories, files)
end end
for testCase in testCases.sort { |x, y| x <=> y } for testCase in testCases.sort { |x, y| x <=> y }
file.write ' testCase(' + testCase + ".allTests),\n" file.write ' testCase(' + testCase + ".allTests),\n"
end end
file.write " ])\n" file.write "])\n"
file.write "#endif\n" file.write "#endif\n"
end end
end end