Skip to content

Commit

Permalink
🚨 (swiftformat): --enable acronyms
Browse files Browse the repository at this point in the history
disable in Tuist/ directory
  • Loading branch information
ladislas committed Dec 6, 2023
1 parent 403d7b4 commit 1a98768
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 11 deletions.
2 changes: 2 additions & 0 deletions .swiftformat
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@

--disable all
--swiftversion 5.9

--enable acronyms
2 changes: 1 addition & 1 deletion Apps/BLEKitExample/Sources/Models/Commands.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ enum LKCommand {
enum Motor {

static let command: UInt8 = 0x20
static let numberOfValues: UInt8 = 1 + 2 + 1 // Id + Spin, Speed + Checksum
static let numberOfValues: UInt8 = 1 + 2 + 1 // ID + Spin, Speed + Checksum
static let left: UInt8 = 0x21
static let right: UInt8 = 0x22

Expand Down
4 changes: 2 additions & 2 deletions Apps/BLEKitExample/Sources/Models/Robot.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Robot: ObservableObject {
@Published var battery: Int = 0
@Published var isCharging: Bool = false

@Published var magicCardId: Int = 0
@Published var magicCardID: Int = 0
@Published var magicCardLanguage: String = ""

let commands = CommandKit()
Expand Down Expand Up @@ -125,7 +125,7 @@ class Robot: ObservableObject {
newChar.onNotification = {
[weak self] data in
if let data = data {
self?.magicCardId = Int(data[1])
self?.magicCardID = Int(data[1])
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Apps/BLEKitExample/Sources/View/RobotView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ struct RobotView: View {
}

Group {
ReadOnlyView(characteristicName: "Magic Card (ID)", characteristicValue: "\(robot.magicCardId)")
ReadOnlyView(characteristicName: "Magic Card (ID)", characteristicValue: "\(robot.magicCardID)")
ReadOnlyView(
characteristicName: "MagicCard (Language)", characteristicValue: robot.magicCardLanguage)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class MelodyGameplay: ObservableObject {
public init(song: MelodySongModel) {
self.song = song
self.state = .playing
self.xyloPlayer.loadMIDIFile(fileUrl: song.midiFile, tempo: song.tempo)
self.xyloPlayer.loadMIDIFile(fileURL: song.midiFile, tempo: song.tempo)
self.midiNotes = xyloPlayer.getMidiNotes()
self.currentNoteNumber = midiNotes[currentNoteIndex].noteNumber - song.octaveGap

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ public class AudioPlayer: NSObject, ObservableObject {
didFinishPlaying = false

do {
let fileUrl = Bundle.module.url(forResource: audioRecording.file, withExtension: "mp3")!
player = try AVAudioPlayer(contentsOf: fileUrl)
let fileURL = Bundle.module.url(forResource: audioRecording.file, withExtension: "mp3")!
player = try AVAudioPlayer(contentsOf: fileURL)
player.delegate = self
} catch {
print("ERROR - mp3 file not found - \(error)")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ class MIDIPlayer: ObservableObject {
}
}

func loadMIDIFile(fileUrl: URL, tempo: Double) {
sequencer.loadMIDIFile(fromURL: fileUrl)
func loadMIDIFile(fileURL: URL, tempo: Double) {
sequencer.loadMIDIFile(fromURL: fileURL)
sequencer.setGlobalMIDIOutput(instrument.midiIn)
sequencer.setTempo(tempo)
}
Expand Down
4 changes: 2 additions & 2 deletions Modules/RobotKit/Sources/Robot+Lights.swift
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ extension Robot {
.spot(position, ids: ids, in: color)
}

static func range(startId: UInt8, endId: UInt8, in color: Color) -> Self {
.range(start: startId, end: endId, in: color)
static func range(startID: UInt8, endID: UInt8, in color: Color) -> Self {
.range(start: startID, end: endID, in: color)
}

var cmd: [[UInt8]] {
Expand Down
5 changes: 5 additions & 0 deletions Tuist/.swiftformat
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Leka - iOS Monorepo
# Copyright 2023 APF France handicap
# SPDX-License-Identifier: Apache-2.0

--disable acronyms

0 comments on commit 1a98768

Please sign in to comment.