From b8c67d5d4f27ad3b2f772cf50f91c581fc94611c Mon Sep 17 00:00:00 2001 From: mbrandonw Date: Tue, 30 Jun 2020 14:49:39 +0000 Subject: [PATCH] Run swift-format --- .../01-GettingStarted-Animations.swift | 4 ++-- .../01-GettingStarted-Bindings-Basics.swift | 3 +-- .../04-HigherOrderReducers-Recursion.swift | 2 +- Examples/LocationManager/Common/AppCore.swift | 3 +-- .../MotionManager/MotionManagerView.swift | 9 +++++---- .../SpeechRecognition/SpeechRecognition.swift | 7 ++++--- .../SpeechRecognitionTests.swift | 4 ++-- Examples/TicTacToe/Sources/Core/GameCore.swift | 6 ++++-- Examples/Todos/TodosTests/TodosTests.swift | 4 ++-- .../VoiceMemos/VoiceMemosTests/VoiceMemosTests.swift | 10 +++++----- Package.swift | 2 +- Tests/ComposableArchitectureTests/ReducerTests.swift | 2 +- 12 files changed, 29 insertions(+), 27 deletions(-) diff --git a/Examples/CaseStudies/SwiftUICaseStudies/01-GettingStarted-Animations.swift b/Examples/CaseStudies/SwiftUICaseStudies/01-GettingStarted-Animations.swift index 808e3a3d23b4..1f35b8934033 100644 --- a/Examples/CaseStudies/SwiftUICaseStudies/01-GettingStarted-Animations.swift +++ b/Examples/CaseStudies/SwiftUICaseStudies/01-GettingStarted-Animations.swift @@ -51,7 +51,7 @@ let animationsReducer = Reducer { state, ac .signpost() .debug() -private let locationManagerReducer = Reducer -{ +private let locationManagerReducer = Reducer { state, action, environment in switch action { diff --git a/Examples/MotionManager/MotionManager/MotionManagerView.swift b/Examples/MotionManager/MotionManager/MotionManagerView.swift index 6859c589372f..845073a6da4a 100644 --- a/Examples/MotionManager/MotionManager/MotionManagerView.swift +++ b/Examples/MotionManager/MotionManager/MotionManagerView.swift @@ -49,10 +49,11 @@ let appReducer = Reducer { state, action, e return .none case .motionUpdate(.failure): - state.alert = .init(title: """ - We encountered a problem with the motion manager. Make sure you run this demo on a real \ - device, not the simulator. - """) + state.alert = .init( + title: """ + We encountered a problem with the motion manager. Make sure you run this demo on a real \ + device, not the simulator. + """) state.isRecording = false return .none diff --git a/Examples/SpeechRecognition/SpeechRecognition/SpeechRecognition.swift b/Examples/SpeechRecognition/SpeechRecognition/SpeechRecognition.swift index 4b51d1d8642a..3cdc16a86ecf 100644 --- a/Examples/SpeechRecognition/SpeechRecognition/SpeechRecognition.swift +++ b/Examples/SpeechRecognition/SpeechRecognition/SpeechRecognition.swift @@ -80,9 +80,10 @@ let appReducer = Reducer { state, action, e return .none case .denied: - state.alert = .init(title: """ - You denied access to speech recognition. This app needs access to transcribe your speech. - """) + state.alert = .init( + title: """ + You denied access to speech recognition. This app needs access to transcribe your speech. + """) return .none case .restricted: diff --git a/Examples/SpeechRecognition/SpeechRecognitionTests/SpeechRecognitionTests.swift b/Examples/SpeechRecognition/SpeechRecognitionTests/SpeechRecognitionTests.swift index 20c45be18d2c..41cf922f8753 100644 --- a/Examples/SpeechRecognition/SpeechRecognitionTests/SpeechRecognitionTests.swift +++ b/Examples/SpeechRecognition/SpeechRecognitionTests/SpeechRecognitionTests.swift @@ -28,8 +28,8 @@ class SpeechRecognitionTests: XCTestCase { .receive(.speechRecognizerAuthorizationStatusResponse(.denied)) { $0.alert = .init( title: """ - You denied access to speech recognition. This app needs access to transcribe your speech. - """ + You denied access to speech recognition. This app needs access to transcribe your speech. + """ ) $0.isRecording = false $0.speechRecognizerAuthorizationStatus = .denied diff --git a/Examples/TicTacToe/Sources/Core/GameCore.swift b/Examples/TicTacToe/Sources/Core/GameCore.swift index 06c384d7040b..bf3f96a50053 100644 --- a/Examples/TicTacToe/Sources/Core/GameCore.swift +++ b/Examples/TicTacToe/Sources/Core/GameCore.swift @@ -93,9 +93,11 @@ extension Array where Element == [Player?] { ] for condition in winConditions { - let matches = condition + let matches = + condition .map { self[$0 % 3][$0 / 3] } - let matchCount = matches + let matchCount = + matches .filter { $0 == player } .count diff --git a/Examples/Todos/TodosTests/TodosTests.swift b/Examples/Todos/TodosTests/TodosTests.swift index 8dfc787995cb..2ea6a3a29289 100644 --- a/Examples/Todos/TodosTests/TodosTests.swift +++ b/Examples/Todos/TodosTests/TodosTests.swift @@ -37,7 +37,7 @@ class TodosTests: XCTestCase { description: "", id: UUID(uuidString: "00000000-0000-0000-0000-000000000000")!, isComplete: false - ), + ) ] ) let store = TestStore( @@ -160,7 +160,7 @@ class TodosTests: XCTestCase { store.assert( .send(.clearCompletedButtonTapped) { $0.todos = [ - $0.todos[0], + $0.todos[0] ] } ) diff --git a/Examples/VoiceMemos/VoiceMemosTests/VoiceMemosTests.swift b/Examples/VoiceMemos/VoiceMemosTests/VoiceMemosTests.swift index 2a508a81a8bf..e2c857c527a5 100644 --- a/Examples/VoiceMemos/VoiceMemosTests/VoiceMemosTests.swift +++ b/Examples/VoiceMemos/VoiceMemosTests/VoiceMemosTests.swift @@ -158,7 +158,7 @@ class VoiceMemosTests: XCTestCase { mode: .notPlaying, title: "", url: URL(string: "https://www.pointfree.co/functions")! - ), + ) ] ), reducer: voiceMemosReducer, @@ -206,7 +206,7 @@ class VoiceMemosTests: XCTestCase { mode: .notPlaying, title: "", url: URL(string: "https://www.pointfree.co/functions")! - ), + ) ] ), reducer: voiceMemosReducer, @@ -241,7 +241,7 @@ class VoiceMemosTests: XCTestCase { mode: .playing(progress: 0.3), title: "", url: URL(string: "https://www.pointfree.co/functions")! - ), + ) ] ), reducer: voiceMemosReducer, @@ -271,7 +271,7 @@ class VoiceMemosTests: XCTestCase { mode: .playing(progress: 0.3), title: "", url: URL(string: "https://www.pointfree.co/functions")! - ), + ) ] ), reducer: voiceMemosReducer, @@ -297,7 +297,7 @@ class VoiceMemosTests: XCTestCase { mode: .notPlaying, title: "", url: URL(string: "https://www.pointfree.co/functions")! - ), + ) ] ), reducer: voiceMemosReducer, diff --git a/Package.swift b/Package.swift index 5b88c5b9b57b..bafdaa5439f0 100644 --- a/Package.swift +++ b/Package.swift @@ -52,7 +52,7 @@ let package = Package( .testTarget( name: "ComposableCoreLocationTests", dependencies: [ - "ComposableCoreLocation", + "ComposableCoreLocation" ] ), .target( diff --git a/Tests/ComposableArchitectureTests/ReducerTests.swift b/Tests/ComposableArchitectureTests/ReducerTests.swift index fe896bd5da07..9c36e5a6a035 100644 --- a/Tests/ComposableArchitectureTests/ReducerTests.swift +++ b/Tests/ComposableArchitectureTests/ReducerTests.swift @@ -202,7 +202,7 @@ final class ReducerTests: XCTestCase { + count: 1   ) - """#, + """# ] ) }