Skip to content

Commit 9a1ed03

Browse files
committed
fixing indenting
1 parent 8793700 commit 9a1ed03

11 files changed

+172
-172
lines changed

Tests/SyntaxKitTests/Integration/BlackjackCardTests.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ internal struct BlackjackCardTests {
1616

1717
let expected = """
1818
struct BlackjackCard {
19-
enum Suit: Character {
20-
case spades = ""
21-
case hearts = ""
22-
case diamonds = ""
23-
case clubs = ""
24-
}
19+
enum Suit: Character {
20+
case spades = ""
21+
case hearts = ""
22+
case diamonds = ""
23+
case clubs = ""
24+
}
2525
}
2626
"""
2727

Tests/SyntaxKitTests/Integration/BlackjackTests.swift

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -36,29 +36,29 @@ internal struct BlackjackTests {
3636

3737
let expected = """
3838
struct BlackjackCard {
39-
enum Suit: Character {
40-
case spades = ""
41-
case hearts = ""
42-
case diamonds = ""
43-
case clubs = ""
44-
}
45-
enum Rank: Int {
46-
case two = 2
47-
case three
48-
case four
49-
case five
50-
case six
51-
case seven
52-
case eight
53-
case nine
54-
case ten
55-
case jack
56-
case queen
57-
case king
58-
case ace
59-
}
60-
let rank: Rank
61-
let suit: Suit
39+
enum Suit: Character {
40+
case spades = ""
41+
case hearts = ""
42+
case diamonds = ""
43+
case clubs = ""
44+
}
45+
enum Rank: Int {
46+
case two = 2
47+
case three
48+
case four
49+
case five
50+
case six
51+
case seven
52+
case eight
53+
case nine
54+
case ten
55+
case jack
56+
case queen
57+
case king
58+
case ace
59+
}
60+
let rank: Rank
61+
let suit: Suit
6262
}
6363
"""
6464

@@ -149,10 +149,10 @@ internal struct BlackjackTests {
149149
let expected = """
150150
struct BlackjackCard {
151151
enum Suit: Character {
152-
case spades = \"\"
153-
case hearts = \"\"
154-
case diamonds = \"\"
155-
case clubs = \"\"
152+
case spades = ""
153+
case hearts = ""
154+
case diamonds = ""
155+
case clubs = ""
156156
}
157157
158158
enum Rank: Int {

Tests/SyntaxKitTests/Integration/CompleteProtocolsExampleTests.swift

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -215,48 +215,48 @@ import Testing
215215
let codeSwift = """
216216
// MARK: - Protocol Definition
217217
protocol Vehicle {
218-
var numberOfWheels: Int { get }
219-
var brand: String { get }
220-
func start()
221-
func stop()
218+
var numberOfWheels: Int { get }
219+
var brand: String { get }
220+
func start()
221+
func stop()
222222
}
223223
224224
// MARK: - Protocol Extension
225225
extension Vehicle {
226-
func start() {
227-
print("Starting \\(brand) vehicle...")
228-
}
226+
func start() {
227+
print("Starting \\(brand) vehicle...")
228+
}
229229
230-
func stop() {
231-
print("Stopping \\(brand) vehicle...")
232-
}
230+
func stop() {
231+
print("Stopping \\(brand) vehicle...")
232+
}
233233
}
234234
235235
// MARK: - Protocol Composition
236236
protocol Electric {
237-
var batteryLevel: Double { get set }
238-
func charge()
237+
var batteryLevel: Double { get set }
238+
func charge()
239239
}
240240
241241
// MARK: - Concrete Types
242242
struct Car: Vehicle {
243-
let numberOfWheels: Int = 4
244-
let brand: String
243+
let numberOfWheels: Int = 4
244+
let brand: String
245245
246-
func start() {
247-
print("Starting \\(brand) car engine...")
248-
}
246+
func start() {
247+
print("Starting \\(brand) car engine...")
248+
}
249249
}
250250
251251
struct ElectricCar: Vehicle, Electric {
252-
let numberOfWheels: Int = 4
253-
let brand: String
254-
var batteryLevel: Double
252+
let numberOfWheels: Int = 4
253+
let brand: String
254+
var batteryLevel: Double
255255
256-
func charge() {
257-
print("Charging \\(brand) electric car...")
258-
batteryLevel = 100.0
259-
}
256+
func charge() {
257+
print("Charging \\(brand) electric car...")
258+
batteryLevel = 100.0
259+
}
260260
}
261261
262262
// MARK: - Usage Example
@@ -265,17 +265,17 @@ import Testing
265265
266266
// Demonstrate protocol usage
267267
func demonstrateVehicle(_ vehicle: Vehicle) {
268-
print("Vehicle brand: \\(vehicle.brand)")
269-
print("Number of wheels: \\(vehicle.numberOfWheels)")
270-
vehicle.start()
271-
vehicle.stop()
268+
print("Vehicle brand: \\(vehicle.brand)")
269+
print("Number of wheels: \\(vehicle.numberOfWheels)")
270+
vehicle.start()
271+
vehicle.stop()
272272
}
273273
274274
// Demonstrate protocol composition
275275
func demonstrateElectricVehicle(_ vehicle: Vehicle & Electric) {
276-
demonstrateVehicle(vehicle)
277-
print("Battery level: \\(vehicle.batteryLevel)%")
278-
vehicle.charge()
276+
demonstrateVehicle(vehicle)
277+
print("Battery level: \\(vehicle.batteryLevel)%")
278+
vehicle.charge()
279279
}
280280
281281
// Test the implementations

Tests/SyntaxKitTests/Integration/ConditionalsExampleTests.swift

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -343,51 +343,51 @@ import Testing
343343
// Simple if statement
344344
let temperature = 25
345345
if temperature > 30 {
346-
print("It's hot outside!")
346+
print("It's hot outside!")
347347
}
348348
349349
// If-else statement
350350
let score = 85
351351
if score >= 90 {
352-
print("Excellent!")
352+
print("Excellent!")
353353
} else if score >= 80 {
354-
print("Good job!")
354+
print("Good job!")
355355
} else if score >= 70 {
356-
print("Passing")
356+
print("Passing")
357357
} else {
358-
print("Needs improvement")
358+
print("Needs improvement")
359359
}
360360
361361
// MARK: - Optional Binding with If
362362
363363
// Using if let for optional binding
364364
let possibleNumber = "123"
365365
if let actualNumber = Int(possibleNumber) {
366-
print("The string \"\\(possibleNumber)\" has an integer value of \\(actualNumber)")
366+
print("The string \"\\(possibleNumber)\" has an integer value of \\(actualNumber)")
367367
} else {
368-
print("The string \"\\(possibleNumber)\" could not be converted to an integer")
368+
print("The string \"\\(possibleNumber)\" could not be converted to an integer")
369369
}
370370
371371
// Multiple optional bindings
372372
let possibleName: String? = "John"
373373
let possibleAge: Int? = 30
374374
if let name = possibleName, let age = possibleAge {
375-
print("\\(name) is \\(age) years old")
375+
print("\\(name) is \\(age) years old")
376376
}
377377
378378
// MARK: - Guard Statements
379379
func greet(person: [String: String]) {
380-
guard let name = person["name"] else {
381-
print("No name provided")
382-
return
383-
}
380+
guard let name = person["name"] else {
381+
print("No name provided")
382+
return
383+
}
384384
385-
guard let age = person["age"], let ageInt = Int(age) else {
386-
print("Invalid age provided")
387-
return
388-
}
385+
guard let age = person["age"], let ageInt = Int(age) else {
386+
print("Invalid age provided")
387+
return
388+
}
389389
390-
print("Hello \\(name), you are \\(ageInt) years old")
390+
print("Hello \\(name), you are \\(ageInt) years old")
391391
}
392392
393393
// MARK: - Switch Statements
@@ -397,44 +397,44 @@ import Testing
397397
let naturalCount: String
398398
switch approximateCount {
399399
case 0:
400-
naturalCount = "no"
400+
naturalCount = "no"
401401
case 1..<5:
402-
naturalCount = "a few"
402+
naturalCount = "a few"
403403
case 5..<12:
404-
naturalCount = "several"
404+
naturalCount = "several"
405405
case 12..<100:
406-
naturalCount = "dozens of"
406+
naturalCount = "dozens of"
407407
case 100..<1000:
408-
naturalCount = "hundreds of"
408+
naturalCount = "hundreds of"
409409
default:
410-
naturalCount = "many"
410+
naturalCount = "many"
411411
}
412412
print("There are \\(naturalCount) \\(countedThings).")
413413
414414
// Switch with tuple matching
415415
let somePoint = (1, 1)
416416
switch somePoint {
417417
case (0, 0):
418-
print("(0, 0) is at the origin")
418+
print("(0, 0) is at the origin")
419419
case (_, 0):
420-
print("(\\(somePoint.0), 0) is on the x-axis")
420+
print("(\\(somePoint.0), 0) is on the x-axis")
421421
case (0, _):
422-
print("(0, \\(somePoint.1)) is on the y-axis")
422+
print("(0, \\(somePoint.1)) is on the y-axis")
423423
case (-2...2, -2...2):
424-
print("(\\(somePoint.0), \\(somePoint.1)) is inside the box")
424+
print("(\\(somePoint.0), \\(somePoint.1)) is inside the box")
425425
default:
426-
print("(\\(somePoint.0), \\(somePoint.1)) is outside of the box")
426+
print("(\\(somePoint.0), \\(somePoint.1)) is outside of the box")
427427
}
428428
429429
// Switch with value binding
430430
let anotherPoint: (Int, Int) = (2, 0)
431431
switch anotherPoint {
432432
case (let x, 0):
433-
print("on the x-axis with an x value of \\(x)")
433+
print("on the x-axis with an x value of \\(x)")
434434
case (0, let y):
435-
print("on the y-axis with a y value of \\(y)")
435+
print("on the y-axis with a y value of \\(y)")
436436
case (let x, let y):
437-
print("somewhere else at (\\(x), \\(y))")
437+
print("somewhere else at (\\(x), \\(y))")
438438
}
439439
440440
// MARK: - Fallthrough
@@ -443,10 +443,10 @@ import Testing
443443
var description = "The number \\(integerToDescribe) is"
444444
switch integerToDescribe {
445445
case 2, 3, 5, 7, 11, 13, 17, 19:
446-
description += " a prime number, and also"
447-
fallthrough
446+
description += " a prime number, and also"
447+
fallthrough
448448
default:
449-
description += " an integer."
449+
description += " an integer."
450450
}
451451
print(description)
452452
@@ -466,17 +466,17 @@ import Testing
466466
var square = 0
467467
var diceRoll = 0
468468
while square != finalSquare {
469-
diceRoll += 1
470-
if diceRoll == 7 { diceRoll = 1 }
471-
switch square + diceRoll {
472-
case finalSquare:
473-
break
474-
case let newSquare where newSquare > finalSquare:
475-
continue
476-
default:
477-
square += diceRoll
478-
square += board[square]
479-
}
469+
diceRoll += 1
470+
if diceRoll == 7 { diceRoll = 1 }
471+
switch square + diceRoll {
472+
case finalSquare:
473+
break
474+
case let newSquare where newSquare > finalSquare:
475+
continue
476+
default:
477+
square += diceRoll
478+
square += board[square]
479+
}
480480
}
481481
"""
482482
.normalize()

Tests/SyntaxKitTests/Unit/AssertionMigrationTests.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ internal struct AssertionMigrationTests {
5252

5353
let expected = """
5454
struct Card {
55-
enum Suit: Character {
56-
case hearts = ""
57-
case spades = ""
58-
}
55+
enum Suit: Character {
56+
case hearts = ""
57+
case spades = ""
58+
}
5959
}
6060
"""
6161

0 commit comments

Comments
 (0)