Skip to content

Commit 7a7c96e

Browse files
committed
Run swiftformat .
1 parent 1d0bad2 commit 7a7c96e

File tree

226 files changed

+298
-560
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

226 files changed

+298
-560
lines changed

01-introduction/fizz_buzz.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ func fizzBuzz(_ number: Int) -> String {
44
let divisibleBy3 = number % 3 == 0
55
let divisibleBy5 = number % 5 == 0
66
switch (divisibleBy3, divisibleBy5) {
7-
case (false, false): return "\(number)"
8-
case (true, false): return "fizz"
9-
case (false, true): return "buzz"
10-
case (true, true): return "fizz buzz"
7+
case (false, false): return "\(number)"
8+
case (true, false): return "fizz"
9+
case (false, true): return "buzz"
10+
case (true, true): return "fizz buzz"
1111
}
1212
}
1313

01-introduction/test_fizz_buzz.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func shell(_ command: String) -> String {
3232

3333
/// Call the fizz-buzz script with a given input and return the script's output.
3434
func fizzBuzz(_ number: Int) -> String {
35-
return shell("./fizz_buzz.swift \(number)")
35+
shell("./fizz_buzz.swift \(number)")
3636
}
3737

3838
/// Check if two input `String`s are equal, printing "PASSED" if true and

04-tdd-in-the-real-world/0-start/AlbertosTests/AlbertosTests.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
import XCTest
21
@testable import Albertos
2+
import XCTest
33

44
class AlbertosTests: XCTestCase {
5-
65
override func setUpWithError() throws {
76
// Put setup code here. This method is called before the invocation of each test method in the class.
87
}
@@ -18,9 +17,8 @@ class AlbertosTests: XCTestCase {
1817

1918
func testPerformanceExample() throws {
2019
// This is an example of a performance test case.
21-
self.measure {
20+
measure {
2221
// Put the code you want to measure the time of here.
2322
}
2423
}
25-
2624
}

04-tdd-in-the-real-world/1-end/Albertos/AlbertosApp.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import SwiftUI
22

33
@main
44
struct AlbertosApp: App {
5-
65
var body: some Scene {
76
WindowGroup {
87
NavigationView {
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
struct MenuItem {
2-
32
let category: String
43
let name: String
54
}
65

76
extension MenuItem: Identifiable {
8-
97
var id: String { name }
108
}
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
struct MenuSection {
2-
32
let category: String
43
let items: [MenuItem]
54
}
65

76
extension MenuSection: Identifiable {
8-
97
var id: String { category }
108
}

04-tdd-in-the-real-world/1-end/AlbertosTests/MenuGroupingTests.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import XCTest
33

44
class MenuGroupingTests: XCTestCase {
5-
65
func testMenuWithManyCategoriesReturnsAsManySectionsInReverseAlphabeticalOrder() {
76
let menu = [
87
MenuItem(category: "pastas", name: "a pasta"),
@@ -22,7 +21,7 @@ class MenuGroupingTests: XCTestCase {
2221
func testMenuWithOneCategoryReturnsOneSection() throws {
2322
let menu = [
2423
MenuItem(category: "pastas", name: "name"),
25-
MenuItem(category: "pastas", name: "other name")
24+
MenuItem(category: "pastas", name: "other name"),
2625
]
2726

2827
let sections = groupMenuByCategory(menu)
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
struct MenuItem {
2-
32
let category: String
43
let name: String
54
let spicy: Bool
65
}
76

87
extension MenuItem: Identifiable {
9-
108
var id: String { name }
119
}

05-fixtures/1-end/AlbertosTests/MenuGroupingTests.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import XCTest
33

44
class MenuGroupingTests: XCTestCase {
5-
65
func testMenuWithManyCategoriesReturnsAsManySectionsInReverseAlphabeticalOrder() {
76
let menu: [MenuItem] = [
87
.fixture(category: "pastas"),
@@ -22,7 +21,7 @@ class MenuGroupingTests: XCTestCase {
2221
func testMenuWithOneCategoryReturnsOneSection() throws {
2322
let menu: [MenuItem] = [
2423
.fixture(category: "pastas", name: "name"),
25-
.fixture(category: "pastas", name: "other name")
24+
.fixture(category: "pastas", name: "other name"),
2625
]
2726

2827
let sections = groupMenuByCategory(menu)
Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
@testable import Albertos
22

33
extension MenuItem {
4-
5-
static func fixture(
6-
category: String = "category",
7-
name: String = "name",
8-
spicy: Bool = false
9-
) -> MenuItem {
10-
MenuItem(category: category, name: name, spicy: spicy)
11-
}
4+
static func fixture(
5+
category: String = "category",
6+
name: String = "name",
7+
spicy: Bool = false
8+
) -> MenuItem {
9+
MenuItem(category: category, name: name, spicy: spicy)
10+
}
1211
}

0 commit comments

Comments
 (0)