Skip to content

Commit

Permalink
🚨 (swiftformat): --enable indent
Browse files Browse the repository at this point in the history
  • Loading branch information
ladislas committed Dec 6, 2023
1 parent 778e41f commit 1db20ff
Show file tree
Hide file tree
Showing 20 changed files with 48 additions and 43 deletions.
5 changes: 5 additions & 0 deletions .swiftformat
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@

--enable hoistTry

--enable indent
--indent 4
--indentcase true
--indentstrings true

# Disabled rules

--disable blankLinesBetweenImports
Expand Down
10 changes: 5 additions & 5 deletions Apps/LekaApp/Sources/Data/TilesContent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,24 +40,24 @@ enum TileData: Int, CaseIterable, Hashable {
title: "Les parcours",
subtitle: "Les parcours sont des compilations d'activités dont la difficulté est évolutive.",
message:
"Les parcours ont pour objectif d'atteindre des compétences précises. Ils ont été pensé avec des professionnels du médico-social. \nVous pouvez réaliser les activités dans l'ordre ou sauter des niveaux."
"Les parcours ont pour objectif d'atteindre des compétences précises. Ils ont été pensé avec des professionnels du médico-social. \nVous pouvez réaliser les activités dans l'ordre ou sauter des niveaux."
)
case .activities:
return TileContent(
image: "dice",
title: "Les activités",
subtitle: "Les activités vous permettent de travailler des compétences variées !",
message:
"Vous trouverez au sein de votre application diverses activités variées. Elles peuvent intéresser les différents métiers du médico-social afin de faire progresser les utilisateurs."
"Vous trouverez au sein de votre application diverses activités variées. Elles peuvent intéresser les différents métiers du médico-social afin de faire progresser les utilisateurs."
)
case .commands:
return TileContent(
image: "gamecontroller",
title: "Les commandes",
subtitle:
"Les commandes vous permettent de créer des activités en utilisant Leka comme médiateur !",
"Les commandes vous permettent de créer des activités en utilisant Leka comme médiateur !",
message:
"Vous pouvez télécommander Leka, le faire tourner, lancer un renforçateur ou encore allumer ses leds dans la couleur souhaitée ! \nL'objectif des commandes est de vous permettre de créer votre propre activité avec l'utilisateur et d'entrer en interaction avec lui."
"Vous pouvez télécommander Leka, le faire tourner, lancer un renforçateur ou encore allumer ses leds dans la couleur souhaitée ! \nL'objectif des commandes est de vous permettre de créer votre propre activité avec l'utilisateur et d'entrer en interaction avec lui."
)
// New company signup path
case .signupBravo:
Expand All @@ -77,7 +77,7 @@ enum TileData: Int, CaseIterable, Hashable {
image: DesignKitAsset.Images.user.name,
title: "ÉTAPE 2 :",
message:
"Nous allons maintenant créer votre premier \nprofil utilisateur (le profil d'une personne que \nvous accompagnez).",
"Nous allons maintenant créer votre premier \nprofil utilisateur (le profil d'une personne que \nvous accompagnez).",
callToActionLabel: "Créer")
case .signupFinalStep:
return TileContent(
Expand Down
4 changes: 2 additions & 2 deletions Apps/LekaApp/Sources/Models/CompanyModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ struct User: Profile {
enum Professions: String, Identifiable, CaseIterable {
// swiftlint:disable identifier_name
case educSpe, eje, monit, monitAt, teach, ASC, psychoMot,
ergo, ortho, kine, pedopsy, med, psy, infir, soign,
AESH, AES, AVDH, auxVieScol, pueri, auxPueri, ludo
ergo, ortho, kine, pedopsy, med, psy, infir, soign,
AESH, AES, AVDH, auxVieScol, pueri, auxPueri, ludo
// swiftlint:enable identifier_name

var id: Self { self }
Expand Down
2 changes: 1 addition & 1 deletion Apps/LekaApp/Sources/Stores/ActivityViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class ActivityViewModel: NSObject, ObservableObject, YamlFileDecodable {
utterance.rate = 0.40
utterance.voice =
Locale.current.language.languageCode?.identifier == "fr"
? AVSpeechSynthesisVoice(language: "fr-FR") : AVSpeechSynthesisVoice(language: "en-US")
? AVSpeechSynthesisVoice(language: "fr-FR") : AVSpeechSynthesisVoice(language: "en-US")

isSpeaking = true
synth.speak(utterance)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ struct RobotConnectionIndicator: View {

Image(
uiImage:
robotViewModel.isConnected
robotViewModel.isConnected
? DesignKitAsset.Images.robotConnected.image : DesignKitAsset.Images.robotDisconnected.image
)
.resizable()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ private class StateSendingFile: GKState, StateEventProcessor {
let startIndex = currentPacket * maximumPacketSize
let endIndex =
currentPacket < expectedCompletePackets
? startIndex + maximumPacketSize - 1 : startIndex + expectedRemainingBytes - 1
? startIndex + maximumPacketSize - 1 : startIndex + expectedRemainingBytes - 1

let dataToSend = globalFirmwareManager.data[startIndex...endIndex]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ private class StateSendingFile: GKState, StateEventProcessor {
let startIndex = currentPacket * maximumPacketSize
let endIndex =
currentPacket < expectedCompletePackets
? startIndex + maximumPacketSize - 1 : startIndex + expectedRemainingBytes - 1
? startIndex + maximumPacketSize - 1 : startIndex + expectedRemainingBytes - 1

let dataToSend = globalFirmwareManager.data[startIndex...endIndex]

Expand Down Expand Up @@ -510,7 +510,7 @@ class UpdateProcessV130: UpdateProcessProtocol {
case is StateInitial:
currentStage.send(.initial)
case is StateLoadingUpdateFile, is StateSettingFileExchangeState, is StateSettingDestinationPath,
is StateClearingFile, is StateSendingFile:
is StateClearingFile, is StateSendingFile:
currentStage.send(.sendingUpdate)
case is StateApplyingUpdate, is StateWaitingForRobotToReboot:
currentStage.send(.installingUpdate)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ struct ForgotPasswordView: View {
.textFieldStyle(.roundedBorder)
.keyboardType(.emailAddress)
if !organisation.mail.isEmpty,
!organisation.isEmailValid() {
!organisation.isEmailValid() {
Text(organisation.invalidEmailAddressText)
.font(.footnote)
.foregroundStyle(.red)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ struct LoginView: View {
.textFieldStyle(.roundedBorder)
.keyboardType(.emailAddress)
if !organisation.mail.isEmpty,
!organisation.isEmailValid() {
!organisation.isEmailValid() {
Text(organisation.invalidEmailAddressText)
.font(.footnote)
.foregroundStyle(.red)
Expand All @@ -47,7 +47,7 @@ struct LoginView: View {
SecureField("password", text: $organisation.password)
.textFieldStyle(.roundedBorder)
if !organisation.password.isEmpty,
!organisation.isPasswordValid(organisation.password) {
!organisation.isPasswordValid(organisation.password) {
Text(organisation.invalidPasswordText)
.font(.footnote)
.lineLimit(2)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ struct SignupView: View {
.textFieldStyle(.roundedBorder)
.keyboardType(.emailAddress)
if !organisation.mail.isEmpty,
!organisation.isEmailValid() {
!organisation.isEmailValid() {
Text(organisation.invalidEmailAddressText)
.font(.footnote)
.foregroundStyle(.red)
Expand All @@ -46,7 +46,7 @@ struct SignupView: View {
SecureField("password", text: $organisation.password)
.textFieldStyle(.roundedBorder)
if !organisation.password.isEmpty,
!organisation.isPasswordValid(organisation.password) {
!organisation.isPasswordValid(organisation.password) {
Text(organisation.invalidPasswordText)
.font(.footnote)
.lineLimit(2)
Expand All @@ -61,8 +61,8 @@ struct SignupView: View {
SecureField("confirm password", text: $organisation.confirmPassword)
.textFieldStyle(.roundedBorder)
if !organisation.password.isEmpty,
(!organisation.confirmPassword.isEmpty
&& !organisation.passwordsMatch()) {
(!organisation.confirmPassword.isEmpty
&& !organisation.passwordsMatch()) {
Text(organisation.invalidConfirmPasswordText)
.font(.footnote)
.foregroundStyle(.red)
Expand Down
2 changes: 1 addition & 1 deletion Modules/BLEKit/Sources/Models/AdvertisingServiceData.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ private func getOsVersion(data: Data) -> String? {
let minor = data[AdvertisingServiceDataIndex.osVersionMinor]
let revision =
Int(data[AdvertisingServiceDataIndex.osVersionRevisionHighByte]) << 8
+ Int(data[AdvertisingServiceDataIndex.osVersionRevisionLowByte])
+ Int(data[AdvertisingServiceDataIndex.osVersionRevisionLowByte])

return "\(major).\(minor).\(revision)"
}
2 changes: 1 addition & 1 deletion Modules/ContentKit/Sources/Exercise/Exercise+Action.swift
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public extension Exercise {
forKey: .type,
in: container,
debugDescription:
"Cannot decode ExercisePayload. Available keys: \(container.allKeys.map { $0.stringValue })"
"Cannot decode ExercisePayload. Available keys: \(container.allKeys.map { $0.stringValue })"
)
}
}
Expand Down
8 changes: 4 additions & 4 deletions Modules/ContentKit/Sources/Exercise/Exercise.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ public struct Exercise: Codable {

switch (interface, gameplay) {
case (.touchToSelect, .findTheRightAnswers),
(.listenThenTouchToSelect, .findTheRightAnswers),
(.observeThenTouchToSelect, .findTheRightAnswers),
(.robotThenTouchToSelect, .findTheRightAnswers):
(.listenThenTouchToSelect, .findTheRightAnswers),
(.observeThenTouchToSelect, .findTheRightAnswers),
(.robotThenTouchToSelect, .findTheRightAnswers):
payload = try container.decode(TouchToSelect.Payload.self, forKey: .payload)

case (.dragAndDropIntoZones, .findTheRightAnswers):
Expand All @@ -49,7 +49,7 @@ public struct Exercise: Codable {
payload = try container.decode(MusicalInstrument.Payload.self, forKey: .payload)

case (.remoteStandard, .none),
(.remoteArrow, .none):
(.remoteArrow, .none):
payload = nil

default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ extension DragAndDropIntoZonesView {
let location = touch.location(in: self)
if let node = self.atPoint(location) as? DraggableImageAnswerNode {
for choice in viewModel.choices
where node.id == choice.id && node.isDraggable {
where node.id == choice.id && node.isDraggable {
selectedNodes[touch] = node
onDragAnimation(node)
node.zPosition += 100
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ struct MusicalInstrumentView: View {
}

guard let instrument = MIDIInstrument(rawValue: payload.instrument),
let scale = MIDIScale(rawValue: payload.scale)
let scale = MIDIScale(rawValue: payload.scale)
else {
fatalError("Instrument or scale not found")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import ContentKit
import Foundation

class GameplayAssociateCategories<ChoiceModelType>: StatefulGameplayProtocol
where ChoiceModelType: GameplayChoiceModelProtocol {
where ChoiceModelType: GameplayChoiceModelProtocol {
var choices: CurrentValueSubject<[GameplayAssociateCategoriesChoiceModel], Never> = .init([])
var state: CurrentValueSubject<ExerciseState, Never> = .init(.idle)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import ContentKit
import Foundation

class GameplayFindTheRightAnswers<ChoiceModelType>: StatefulGameplayProtocol
where ChoiceModelType: GameplayChoiceModelProtocol {
where ChoiceModelType: GameplayChoiceModelProtocol {
var choices: CurrentValueSubject<[ChoiceModelType], Never> = .init([])
var rightAnswers: [ChoiceModelType] = []
var state: CurrentValueSubject<ExerciseState, Never> = .init(.idle)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ struct ActivityProgressBar: View {
let dotColor: Color = {
guard
sequenceIndex < viewModel.currentSequenceIndex
|| (sequenceIndex == viewModel.currentSequenceIndex
&& exerciseIndex < viewModel.currentExerciseIndexInSequence)
|| (sequenceIndex == viewModel.currentSequenceIndex
&& exerciseIndex < viewModel.currentExerciseIndexInSequence)
else {
return .white
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ extension l10n {
static let localizedStringInterpolationWithMarkdown = LocalizedStringInterpolation(
"localized_string_interpolation_with_markdown",
value:
"⛳ **DEFAULT** *localized_string_interpolation_with_markdown* - **text: %@** - *int: %lld* - ***float: %f***",
"⛳ **DEFAULT** *localized_string_interpolation_with_markdown* - **text: %@** - *int: %lld* - ***float: %f***",
comment: "")
}

Expand Down
22 changes: 11 additions & 11 deletions Modules/RobotKit/Sources/Robot+Lights.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,17 @@ public extension Robot {
public var color: Robot.Color {
switch self {
case let .all(color),
let .full(_, color),
let .halfLeft(color),
let .halfRight(color),
let .quarterFrontLeft(color),
let .quarterFrontRight(color),
let .quarterBackLeft(color),
let .quarterBackRight(color),
let .earLeft(color),
let .earRight(color),
let .spot(_, _, color),
let .range(_, _, color):
let .full(_, color),
let .halfLeft(color),
let .halfRight(color),
let .quarterFrontLeft(color),
let .quarterFrontRight(color),
let .quarterBackLeft(color),
let .quarterBackRight(color),
let .earLeft(color),
let .earRight(color),
let .spot(_, _, color),
let .range(_, _, color):
return color
}
}
Expand Down

0 comments on commit 1db20ff

Please sign in to comment.