Browse Source

Swiftformat.

pull/113/head
Abhishek 3 years ago
parent
commit
add37287c3
  1. 6
      Clocker/CoreLoggerKit/Package.swift
  2. 2
      Clocker/CoreLoggerKit/Tests/CoreLoggerKitTests/CoreLoggerKitTests.swift
  3. 2
      Clocker/CoreLoggerKit/Tests/CoreLoggerKitTests/XCTestManifests.swift
  4. 8
      Clocker/CoreModelKit/Package.swift
  5. 2
      Clocker/CoreModelKit/Sources/CoreModelKit/TimezoneData.swift
  6. 2
      Clocker/CoreModelKit/Tests/CoreModelKitTests/XCTestManifests.swift
  7. 8
      Clocker/Events and Reminders/CalendarHandler.swift
  8. 3
      Clocker/Events and Reminders/RemindersHandler.swift
  9. 10
      Clocker/Menu Bar/StatusContainerView.swift
  10. 3
      Clocker/Menu Bar/StatusItemHandler.swift
  11. 8
      Clocker/Menu Bar/StatusItemView.swift

6
Clocker/CoreLoggerKit/Package.swift

@ -6,13 +6,13 @@ import PackageDescription
let package = Package(
name: "CoreLoggerKit",
platforms: [
.macOS(.v10_12),
.macOS(.v10_12)
],
products: [
.library(
name: "CoreLoggerKit",
targets: ["CoreLoggerKit"]
),
)
],
dependencies: [],
targets: [
@ -23,6 +23,6 @@ let package = Package(
.testTarget(
name: "CoreLoggerKitTests",
dependencies: ["CoreLoggerKit"]
),
)
]
)

2
Clocker/CoreLoggerKit/Tests/CoreLoggerKitTests/CoreLoggerKitTests.swift

@ -3,6 +3,6 @@ import XCTest
final class CoreLoggerKitTests: XCTestCase {
static var allTests = [
("testExample", testExample),
("testExample", testExample)
]
}

2
Clocker/CoreLoggerKit/Tests/CoreLoggerKitTests/XCTestManifests.swift

@ -3,7 +3,7 @@ import XCTest
#if !canImport(ObjectiveC)
public func allTests() -> [XCTestCaseEntry] {
return [
testCase(CoreLoggerKitTests.allTests),
testCase(CoreLoggerKitTests.allTests)
]
}
#endif

8
Clocker/CoreModelKit/Package.swift

@ -6,19 +6,19 @@ import PackageDescription
let package = Package(
name: "CoreModelKit",
platforms: [
.macOS(.v10_12),
.macOS(.v10_12)
],
products: [
// Products define the executables and libraries a package produces, and make them visible to other packages.
.library(
name: "CoreModelKit",
targets: ["CoreModelKit"]
),
)
],
dependencies: [
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
.package(path: "../CoreLoggerKit/"),
.package(path: "../CoreLoggerKit/")
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
@ -30,6 +30,6 @@ let package = Package(
.testTarget(
name: "CoreModelKitTests",
dependencies: ["CoreModelKit", "CoreLoggerKit"]
),
)
]
)

2
Clocker/CoreModelKit/Sources/CoreModelKit/TimezoneData.swift

@ -66,7 +66,7 @@ public class TimezoneData: NSObject, NSCoding {
// Suffix
NSNumber(integerLiteral: 9): DateFormat.twelveHourWithoutSuffix,
NSNumber(integerLiteral: 10): DateFormat.twelveHourWithoutSuffixAndSeconds,
NSNumber(integerLiteral: 11): DateFormat.epochTime,
NSNumber(integerLiteral: 11): DateFormat.epochTime
]
public var customLabel: String?

2
Clocker/CoreModelKit/Tests/CoreModelKitTests/XCTestManifests.swift

@ -3,7 +3,7 @@ import XCTest
#if !canImport(ObjectiveC)
public func allTests() -> [XCTestCaseEntry] {
return [
testCase(CoreModelKitTests.allTests),
testCase(CoreModelKitTests.allTests)
]
}
#endif

8
Clocker/Events and Reminders/CalendarHandler.swift

@ -383,7 +383,7 @@ extension EventCenter {
// Borrowing logic from Ityscal
@discardableResult
private func findAppropriateURLs(_ description: String) -> URL? {
guard let results = EventCenter.dataDetector?.matches(in: description, options: .reportCompletion, range: NSMakeRange(0, description.count)) else {
guard let results = EventCenter.dataDetector?.matches(in: description, options: .reportCompletion, range: NSRange(location: 0, length: description.count)) else {
return nil
}
for result in results {
@ -391,8 +391,7 @@ extension EventCenter {
// Check for Zoom links
if actualLink.contains("zoom.us/j/")
|| actualLink.contains("zoom.us/s/")
|| actualLink.contains("zoom.us/w/")
{
|| actualLink.contains("zoom.us/w/") {
// Create a Zoom App link
let workspace = NSWorkspace.shared
if workspace.urlForApplication(toOpen: URL(string: "zoommtg://")!) != nil {
@ -418,8 +417,7 @@ extension EventCenter {
|| actualLink.contains("public.senfcall.de")
|| actualLink.contains("youcanbook.me/zoom/")
|| actualLink.contains("workplace.com/groupcall")
|| actualLink.contains("bluejeans.com/")
{
|| actualLink.contains("bluejeans.com/") {
if let meetingLink = result.url {
return meetingLink
}

3
Clocker/Events and Reminders/RemindersHandler.swift

@ -51,8 +51,7 @@ extension EventCenter {
timezone: String,
alertIndex: Int,
reminderDate: Date,
additionalNotes: String?) -> Bool
{
additionalNotes: String?) -> Bool {
initializeStoreIfNeccesary()
if reminderAccessNotDetermined() || reminderAccessDenied() {

10
Clocker/Menu Bar/StatusContainerView.swift

@ -31,12 +31,10 @@ func compactWidth(for timezone: TimezoneData) -> Int {
if timeFormat == DateFormat.twelveHour
|| timeFormat == DateFormat.twelveHourWithSeconds
|| timeFormat == DateFormat.twelveHourWithZero
|| timeFormat == DateFormat.twelveHourWithSeconds
{
|| timeFormat == DateFormat.twelveHourWithSeconds {
totalWidth += 20
} else if timeFormat == DateFormat.twentyFourHour
|| timeFormat == DateFormat.twentyFourHourWithSeconds
{
|| timeFormat == DateFormat.twentyFourHourWithSeconds {
totalWidth += 0
}
@ -77,7 +75,7 @@ class StatusContainerView: NSView {
let timeBasedAttributes = [
NSAttributedString.Key.font: compactModeTimeFont,
NSAttributedString.Key.backgroundColor: NSColor.clear,
NSAttributedString.Key.paragraphStyle: defaultParagraphStyle,
NSAttributedString.Key.paragraphStyle: defaultParagraphStyle
]
func containerWidth(for timezones: [Data]) -> CGFloat {
@ -136,7 +134,7 @@ class StatusContainerView: NSView {
NSAttributedString.Key.font: compactModeTimeFont,
NSAttributedString.Key.foregroundColor: textColor,
NSAttributedString.Key.backgroundColor: NSColor.clear,
NSAttributedString.Key.paragraphStyle: defaultParagraphStyle,
NSAttributedString.Key.paragraphStyle: defaultParagraphStyle
]
let operation = TimezoneDataOperations(with: timezone)

3
Clocker/Menu Bar/StatusItemHandler.swift

@ -112,8 +112,7 @@ class StatusItemHandler: NSObject {
userNotificationsDidChangeNotif = center.addObserver(forName: UserDefaults.didChangeNotification,
object: self,
queue: mainQueue)
{ _ in
queue: mainQueue) { _ in
self.setupStatusItem()
}
}

8
Clocker/Menu Bar/StatusItemView.swift

@ -49,7 +49,7 @@ class StatusItemView: NSView {
NSAttributedString.Key.font: compactModeTimeFont,
NSAttributedString.Key.foregroundColor: textColor,
NSAttributedString.Key.backgroundColor: NSColor.clear,
NSAttributedString.Key.paragraphStyle: defaultParagraphStyle,
NSAttributedString.Key.paragraphStyle: defaultParagraphStyle
]
return attributes
}
@ -61,7 +61,7 @@ class StatusItemView: NSView {
NSAttributedString.Key.font: NSFont.boldSystemFont(ofSize: 10),
NSAttributedString.Key.foregroundColor: textColor,
NSAttributedString.Key.backgroundColor: NSColor.clear,
NSAttributedString.Key.paragraphStyle: defaultParagraphStyle,
NSAttributedString.Key.paragraphStyle: defaultParagraphStyle
]
return textFontAttributes
}
@ -90,14 +90,14 @@ class StatusItemView: NSView {
locationView.leadingAnchor.constraint(equalTo: leadingAnchor),
locationView.trailingAnchor.constraint(equalTo: trailingAnchor),
locationView.topAnchor.constraint(equalTo: topAnchor, constant: 7),
locationView.heightAnchor.constraint(equalTo: heightAnchor, multiplier: 0.35),
locationView.heightAnchor.constraint(equalTo: heightAnchor, multiplier: 0.35)
])
NSLayoutConstraint.activate([
timeView.leadingAnchor.constraint(equalTo: leadingAnchor),
timeView.trailingAnchor.constraint(equalTo: trailingAnchor, constant: 0),
timeView.topAnchor.constraint(equalTo: locationView.bottomAnchor),
timeView.bottomAnchor.constraint(equalTo: bottomAnchor),
timeView.bottomAnchor.constraint(equalTo: bottomAnchor)
])
}

Loading…
Cancel
Save