Skip to content

Commit 04919f4

Browse files
authored
better format (#10)
motivation: adjust format to xcode format changes: * update .swiftformat no-indent setting and run formatter * update test generation script to match desired format
1 parent 2bca6dd commit 04919f4

File tree

5 files changed

+31
-29
lines changed

5 files changed

+31
-29
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
/*.xcodeproj
55

66
Package.resolved
7+
.swiftpm

.swiftformat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@
88
--patternlet inline
99
--stripunusedargs unnamed-only
1010
--comments ignore
11+
--ifdef no-indent
1112

1213
# rules

Tests/LinuxMain.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ import XCTest
2323
///
2424

2525
#if os(Linux) || os(FreeBSD)
26-
@testable import StatsdClientTests
26+
@testable import StatsdClientTests
2727

28-
XCTMain([
29-
testCase(StatsdClientTests.allTests),
30-
])
28+
XCTMain([
29+
testCase(StatsdClientTests.allTests),
30+
])
3131
#endif

Tests/StatsdClientTests/XCTestManifests.swift

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,27 @@
1313
//===----------------------------------------------------------------------===//
1414

1515
#if !canImport(ObjectiveC)
16-
import XCTest
16+
import XCTest
1717

18-
extension StatsdClientTests {
19-
// DO NOT MODIFY: This is autogenerated, use:
20-
// `swift test --generate-linuxmain`
21-
// to regenerate.
22-
static let __allTests__StatsdClientTests = [
23-
("testCouncurrency", testCouncurrency),
24-
("testCounter", testCounter),
25-
("testCounterOverflow", testCounterOverflow),
26-
("testGaugeDouble", testGaugeDouble),
27-
("testGaugeInteger", testGaugeInteger),
28-
("testRecorderDouble", testRecorderDouble),
29-
("testRecorderInteger", testRecorderInteger),
30-
("testTimer", testTimer),
31-
]
32-
}
18+
extension StatsdClientTests {
19+
// DO NOT MODIFY: This is autogenerated, use:
20+
// `swift test --generate-linuxmain`
21+
// to regenerate.
22+
static let __allTests__StatsdClientTests = [
23+
("testCouncurrency", testCouncurrency),
24+
("testCounter", testCounter),
25+
("testCounterOverflow", testCounterOverflow),
26+
("testGaugeDouble", testGaugeDouble),
27+
("testGaugeInteger", testGaugeInteger),
28+
("testRecorderDouble", testRecorderDouble),
29+
("testRecorderInteger", testRecorderInteger),
30+
("testTimer", testTimer),
31+
]
32+
}
3333

34-
public func __allTests() -> [XCTestCaseEntry] {
35-
return [
36-
testCase(StatsdClientTests.__allTests__StatsdClientTests),
37-
]
38-
}
34+
public func __allTests() -> [XCTestCaseEntry] {
35+
return [
36+
testCase(StatsdClientTests.__allTests__StatsdClientTests),
37+
]
38+
}
3939
#endif

scripts/generate_linux_tests.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,10 @@ def createLinuxMain(testsDirectory, allTestSubDirectories, files)
9696

9797
file.write "#if os(Linux) || os(FreeBSD)\n"
9898
for testSubDirectory in allTestSubDirectories.sort { |x, y| x <=> y }
99-
file.write ' @testable import ' + testSubDirectory + "\n"
99+
file.write '@testable import ' + testSubDirectory + "\n"
100100
end
101101
file.write "\n"
102-
file.write " XCTMain([\n"
102+
file.write "XCTMain([\n"
103103

104104
testCases = []
105105
for classes in files
@@ -109,9 +109,9 @@ def createLinuxMain(testsDirectory, allTestSubDirectories, files)
109109
end
110110

111111
for testCase in testCases.sort { |x, y| x <=> y }
112-
file.write ' testCase(' + testCase + ".allTests),\n"
112+
file.write ' testCase(' + testCase + ".allTests),\n"
113113
end
114-
file.write " ])\n"
114+
file.write "])\n"
115115
file.write "#endif\n"
116116
end
117117
end

0 commit comments

Comments
 (0)