Skip to content

Commit 697071e

Browse files
committed
Quick SwiftLint tidy-ups
1 parent c56679b commit 697071e

14 files changed

+27
-27
lines changed

ConfCore/DateAdapter.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import Foundation
1010

11-
public let ConfCoreDateFormat = "yyyy-MM-dd'T'HH:mm:ssZZZZZ"
11+
public let confCoreDateFormat = "yyyy-MM-dd'T'HH:mm:ssZZZZZ"
1212

1313
final class DateAdapter: Adapter {
1414
typealias InputType = String
@@ -34,7 +34,7 @@ final class DateTimeAdapter: Adapter {
3434

3535
func adapt(_ input: String) -> Result<Date, AdapterError> {
3636
let formatter = DateFormatter()
37-
formatter.dateFormat = ConfCoreDateFormat
37+
formatter.dateFormat = confCoreDateFormat
3838
formatter.locale = Locale(identifier: "en-US")
3939
formatter.timeZone = TimeZone.current
4040

ConfCoreTests/AdapterTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class AdapterTests: XCTestCase {
1414

1515
private let dateTimeFormatter: DateFormatter = {
1616
let formatter = DateFormatter()
17-
formatter.dateFormat = ConfCoreDateFormat
17+
formatter.dateFormat = confCoreDateFormat
1818
formatter.locale = Locale(identifier: "en-US")
1919
formatter.timeZone = TimeZone.current
2020
return formatter

PlayerUI/Protocols/PUIPlayerViewDelegates.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ public protocol PUIPlayerViewAppearanceDelegate: class {
2828
func playerViewShouldShowTimestampLabels(_ playerView: PUIPlayerView) -> Bool
2929
func playerViewShouldShowExternalPlaybackControls(_ playerView: PUIPlayerView) -> Bool
3030
func playerViewShouldShowFullScreenButton(_ playerView: PUIPlayerView) -> Bool
31-
func PlayerViewShouldShowBackAndForward30SecondsButtons(_ playerView: PUIPlayerView) -> Bool
31+
func playerViewShouldShowBackAndForward30SecondsButtons(_ playerView: PUIPlayerView) -> Bool
3232

3333
}

PlayerUI/Util/DebugLog.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import Foundation
1010

11-
func DebugLog(_ items: Any...) {
11+
func debugLog(_ items: Any...) {
1212
#if DEBUG
1313
print(items)
1414
#endif

PlayerUI/Views/PUIButton.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ public final class PUIButton: NSControl {
148148
shouldDrawHighlighted = true
149149

150150
if !sendsActionOnMouseDown {
151-
window?.trackEvents(matching: [.leftMouseUp, .leftMouseDragged], timeout: NSEvent.foreverDuration, mode: .eventTrackingRunLoopMode) { e, stop in
152-
if e?.type == .leftMouseUp {
151+
window?.trackEvents(matching: [.leftMouseUp, .leftMouseDragged], timeout: NSEvent.foreverDuration, mode: .eventTrackingRunLoopMode) { event, stop in
152+
if event?.type == .leftMouseUp {
153153
self.shouldDrawHighlighted = false
154154
stop.pointee = true
155155
}

PlayerUI/Views/PUIPlayerView.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,7 @@ public final class PUIPlayerView: NSView {
736736
backButton.isHidden = disableBackAndForward
737737
forwardButton.isHidden = disableBackAndForward
738738

739-
let skipBy30 = d.PlayerViewShouldShowBackAndForward30SecondsButtons(self)
739+
let skipBy30 = d.playerViewShouldShowBackAndForward30SecondsButtons(self)
740740
backButton.image = skipBy30 ? .PUIBack30s : .PUIBack15s
741741
backButton.action = skipBy30 ? #selector(goBackInTime30) : #selector(goBackInTime15)
742742
backButton.toolTip = skipBy30 ? "Go back 30s" : "Go back 15s"
@@ -778,10 +778,10 @@ public final class PUIPlayerView: NSView {
778778

779779
fileprivate func updateExternalPlaybackMenus() {
780780
// clean menu
781-
extrasMenuContainerView.arrangedSubviews.enumerated().forEach { idx, v in
781+
extrasMenuContainerView.arrangedSubviews.enumerated().forEach { idx, view in
782782
guard idx < extrasMenuContainerView.arrangedSubviews.count - 1 else { return }
783783

784-
extrasMenuContainerView.removeArrangedSubview(v)
784+
extrasMenuContainerView.removeArrangedSubview(view)
785785
}
786786

787787
// repopulate

PlayerUI/Views/PUIPlayerWindow.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,8 @@ open class PUIPlayerWindow: NSWindow {
183183
}, completionHandler: nil)
184184
}
185185

186-
open override func standardWindowButton(_ b: NSWindow.ButtonType) -> NSButton? {
187-
guard let button = super.standardWindowButton(b) else { return nil }
186+
open override func standardWindowButton(_ type: NSWindow.ButtonType) -> NSButton? {
187+
guard let button = super.standardWindowButton(type) else { return nil }
188188

189189
titlebarWidgets.insert(button)
190190

PlayerUI/Views/PUITimelineView.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -236,11 +236,11 @@ public final class PUITimelineView: NSView {
236236

237237
var startedInteractiveSeek = false
238238

239-
window?.trackEvents(matching: [.pressure, .leftMouseUp, .leftMouseDragged, .tabletPoint], timeout: NSEvent.foreverDuration, mode: .eventTrackingRunLoopMode) { e, stop in
240-
let point = self.convert((e?.locationInWindow)!, from: nil)
239+
window?.trackEvents(matching: [.pressure, .leftMouseUp, .leftMouseDragged, .tabletPoint], timeout: NSEvent.foreverDuration, mode: .eventTrackingRunLoopMode) { event, stop in
240+
let point = self.convert((event?.locationInWindow)!, from: nil)
241241
let progress = Double(point.x / self.bounds.width)
242242

243-
switch e?.type {
243+
switch event?.type {
244244
case .leftMouseUp?:
245245
if startedInteractiveSeek {
246246
self.viewDelegate?.timelineViewDidFinishInteractiveSeek()
@@ -251,7 +251,7 @@ public final class PUITimelineView: NSView {
251251

252252
stop.pointee = true
253253
case .pressure?, .tabletPoint?:
254-
switch e?.touchForce {
254+
switch event?.touchForce {
255255
case .forceTouch?:
256256
guard self.hasValidMediaDuration else {
257257
stop.pointee = true
@@ -260,7 +260,7 @@ public final class PUITimelineView: NSView {
260260

261261
let timestamp = self.mediaDuration * progress
262262

263-
DebugLog("Force touch at \(timestamp)s")
263+
debugLog("Force touch at \(timestamp)s")
264264

265265
self.viewDelegate?.timelineDidReceiveForceTouch(at: timestamp)
266266

WWDC/AppCoordinator.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ final class AppCoordinator {
8686

8787
self.windowController = windowController
8888

89-
liveObserver = LiveObserver(dateProvider: Today, storage: storage)
89+
liveObserver = LiveObserver(dateProvider: today, storage: storage)
9090

9191
setupBindings()
9292
setupDelegation()

WWDC/DateProvider.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ import ConfCore
1111

1212
typealias DateProvider = () -> Date
1313

14-
let Today: DateProvider = {
14+
let today: DateProvider = {
1515
if let fakeDate = Arguments.deloreanDate {
1616
let formatter = DateFormatter()
17-
formatter.dateFormat = ConfCoreDateFormat
17+
formatter.dateFormat = confCoreDateFormat
1818
return formatter.date(from: fakeDate)!
1919
} else {
2020
return Date()

0 commit comments

Comments
 (0)