Skip to content

Commit

Permalink
SwiftLint (Codacy)
Browse files Browse the repository at this point in the history
  • Loading branch information
jguz-pubnub committed Sep 10, 2024
1 parent fe04589 commit 73803fb
Show file tree
Hide file tree
Showing 28 changed files with 205 additions and 225 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import Foundation
class SubscriptionListenersContainer {
private let eventListenersCache: Atomic<[UUID: EventListener]> = Atomic([:])
private let statusListenersCache: Atomic<[UUID: StatusListener]> = Atomic([:])

var eventListeners: [EventListener] {
eventListenersCache.lockedRead { $0.values.compactMap { $0 } }
}
Expand Down
17 changes: 7 additions & 10 deletions Sources/PubNub/KMP/KMPPubNub +ChannelGroups.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,16 @@
// This source code is licensed under the license found in the
// LICENSE file in the root directory of this source tree.
//
// IMPORTANT NOTE FOR DEVELOPERS USING THIS SDK
//
// All public symbols in this file are intended to allow interoperation with Kotlin Multiplatform for other PubNub frameworks.
// While these symbols are public, they are intended strictly for internal usage.
//
// External developers should refrain from directly using these symbols in their code, as their implementation details
// may change in future versions of the framework, potentially leading to breaking changes.

import Foundation

/// IMPORTANT NOTE FOR DEVELOPERS USING THIS SDK
///
/// All public symbols in this file are intended to allow interoperation with Kotlin Multiplatform for other PubNub frameworks.
/// While these symbols are public, they are intended strictly for internal usage.
///
/// External developers should refrain from directly using these symbols in their code, as their implementation details
/// may change in future versions of the framework, potentially leading to breaking changes.

// MARK: - Channel group management

@objc
public extension KMPPubNub {
func addChannels(
Expand Down
17 changes: 7 additions & 10 deletions Sources/PubNub/KMP/KMPPubNub +MessageActions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,16 @@
// This source code is licensed under the license found in the
// LICENSE file in the root directory of this source tree.
//
// IMPORTANT NOTE FOR DEVELOPERS USING THIS SDK
//
// All public symbols in this file are intended to allow interoperation with Kotlin Multiplatform for other PubNub frameworks.
// While these symbols are public, they are intended strictly for internal usage.
//
// External developers should refrain from directly using these symbols in their code, as their implementation details
// may change in future versions of the framework, potentially leading to breaking changes.

import Foundation

/// IMPORTANT NOTE FOR DEVELOPERS USING THIS SDK
///
/// All public symbols in this file are intended to allow interoperation with Kotlin Multiplatform for other PubNub frameworks.
/// While these symbols are public, they are intended strictly for internal usage.
///
/// External developers should refrain from directly using these symbols in their code, as their implementation details
/// may change in future versions of the framework, potentially leading to breaking changes.

// MARK: - Message Actions

@objc
public extension KMPPubNub {
func addMessageAction(
Expand Down
20 changes: 10 additions & 10 deletions Sources/PubNub/KMP/KMPPubNub +Presence.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,16 @@
// This source code is licensed under the license found in the
// LICENSE file in the root directory of this source tree.
//
// IMPORTANT NOTE FOR DEVELOPERS USING THIS SDK
//
// All public symbols in this file are intended to allow interoperation with Kotlin Multiplatform for other PubNub frameworks.
// While these symbols are public, they are intended strictly for internal usage.
//
// External developers should refrain from directly using these symbols in their code, as their implementation details
// may change in future versions of the framework, potentially leading to breaking changes.

import Foundation

/// IMPORTANT NOTE FOR DEVELOPERS USING THIS SDK
///
/// All public symbols in this file are intended to allow interoperation with Kotlin Multiplatform for other PubNub frameworks.
/// While these symbols are public, they are intended strictly for internal usage.
///
/// External developers should refrain from directly using these symbols in their code, as their implementation details
/// may change in future versions of the framework, potentially leading to breaking changes.

// MARK: - Presence

@objc
public extension KMPPubNub {
func hereNow(
Expand Down Expand Up @@ -103,6 +100,7 @@ public extension KMPPubNub {
}
}

// swiftlint:disable todo
// TODO: It's not possible to set Presence state other than [String: JSONCodableScalar] in Swift SDK

func setPresenceState(
Expand All @@ -125,4 +123,6 @@ public extension KMPPubNub {
}
}
}

// swiftlint:enable todo
}
18 changes: 10 additions & 8 deletions Sources/PubNub/KMP/KMPPubNub+AppContext.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,16 @@
// This source code is licensed under the license found in the
// LICENSE file in the root directory of this source tree.
//
// IMPORTANT NOTE FOR DEVELOPERS USING THIS SDK
//
// All public symbols in this file are intended to allow interoperation with Kotlin Multiplatform for other PubNub frameworks.
// While these symbols are public, they are intended strictly for internal usage.
//
// External developers should refrain from directly using these symbols in their code, as their implementation details
// may change in future versions of the framework, potentially leading to breaking changes.

import Foundation

/// IMPORTANT NOTE FOR DEVELOPERS USING THIS SDK
///
/// All public symbols in this file are intended to allow interoperation with Kotlin Multiplatform for other PubNub frameworks.
/// While these symbols are public, they are intended strictly for internal usage.
///
/// External developers should refrain from directly using these symbols in their code, as their implementation details
/// may change in future versions of the framework, potentially leading to breaking changes.

extension KMPPubNub {
private func objectSortProperties(from properties: [KMPObjectSortProperty]) -> [PubNub.ObjectSortField] {
properties.compactMap {
Expand Down Expand Up @@ -58,6 +57,7 @@ extension KMPPubNub {
}
}

// swiftlint:disable todo
// TODO: Swift SDK allows to sort by the status field, it's not present in KMP

private func mapToMembershipSortFields(from array: [String]) -> [PubNub.MembershipSortField] {
Expand All @@ -76,6 +76,8 @@ extension KMPPubNub {
}
}
}

// swiftlint:enable todo
}

@objc
Expand Down
18 changes: 10 additions & 8 deletions Sources/PubNub/KMP/KMPPubNub+Files.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,16 @@
// This source code is licensed under the license found in the
// LICENSE file in the root directory of this source tree.
//
// IMPORTANT NOTE FOR DEVELOPERS USING THIS SDK
//
// All public symbols in this file are intended to allow interoperation with Kotlin Multiplatform for other PubNub frameworks.
// While these symbols are public, they are intended strictly for internal usage.
//
// External developers should refrain from directly using these symbols in their code, as their implementation details
// may change in future versions of the framework, potentially leading to breaking changes.

import Foundation

/// IMPORTANT NOTE FOR DEVELOPERS USING THIS SDK
///
/// All public symbols in this file are intended to allow interoperation with Kotlin Multiplatform for other PubNub frameworks.
/// While these symbols are public, they are intended strictly for internal usage.
///
/// External developers should refrain from directly using these symbols in their code, as their implementation details
/// may change in future versions of the framework, potentially leading to breaking changes.

extension KMPPubNub {
var defaultFileDownloadPath: URL {
FileManager.default.temporaryDirectory.appendingPathComponent("pubnub-chat-sdk")
Expand Down Expand Up @@ -97,6 +96,7 @@ public extension KMPPubNub {
}
}

// swiftlint:disable todo
// TODO: Missing contentType and fileSize from KMP which are required in Swift SDK

func publishFileMessage(
Expand Down Expand Up @@ -144,6 +144,8 @@ public extension KMPPubNub {
}
}

// swiftlint:enable todo

func downloadFile(
channel: String,
fileName: String,
Expand Down
18 changes: 10 additions & 8 deletions Sources/PubNub/KMP/KMPPubNub+History.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,16 @@
// This source code is licensed under the license found in the
// LICENSE file in the root directory of this source tree.
//
// IMPORTANT NOTE FOR DEVELOPERS USING THIS SDK
//
// All public symbols in this file are intended to allow interoperation with Kotlin Multiplatform for other PubNub frameworks.
// While these symbols are public, they are intended strictly for internal usage.
//
// External developers should refrain from directly using these symbols in their code, as their implementation details
// may change in future versions of the framework, potentially leading to breaking changes.

import Foundation

/// IMPORTANT NOTE FOR DEVELOPERS USING THIS SDK
///
/// All public symbols in this file are intended to allow interoperation with Kotlin Multiplatform for other PubNub frameworks.
/// While these symbols are public, they are intended strictly for internal usage.
///
/// External developers should refrain from directly using these symbols in their code, as their implementation details
/// may change in future versions of the framework, potentially leading to breaking changes.

@objc
public extension KMPPubNub {
func fetchMessages(
Expand Down Expand Up @@ -54,6 +53,7 @@ public extension KMPPubNub {
}
}

// swiftlint:disable todo
// TODO: Deleting history from more than one channel isn't supported in Swift SDK

func deleteMessages(
Expand Down Expand Up @@ -84,6 +84,8 @@ public extension KMPPubNub {
}
}

// swiftlint:enable todo

func messageCounts(
for channels: [String],
channelsTimetokens: [Timetoken],
Expand Down
15 changes: 7 additions & 8 deletions Sources/PubNub/KMP/KMPPubNub+Listeners.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,16 @@
// This source code is licensed under the license found in the
// LICENSE file in the root directory of this source tree.
//
// IMPORTANT NOTE FOR DEVELOPERS USING THIS SDK
//
// All public symbols in this file are intended to allow interoperation with Kotlin Multiplatform for other PubNub frameworks.
// While these symbols are public, they are intended strictly for internal usage.
//
// External developers should refrain from directly using these symbols in their code, as their implementation details
// may change in future versions of the framework, potentially leading to breaking changes.

import Foundation

/// IMPORTANT NOTE FOR DEVELOPERS USING THIS SDK
///
/// All public symbols in this file are intended to allow interoperation with Kotlin Multiplatform for other PubNub frameworks.
/// While these symbols are public, they are intended strictly for internal usage.
///
/// External developers should refrain from directly using these symbols in their code, as their implementation details
/// may change in future versions of the framework, potentially leading to breaking changes.

extension KMPPubNub {
func createEventListener(from listener: KMPEventListener) -> EventListener {
EventListener(
Expand Down
15 changes: 7 additions & 8 deletions Sources/PubNub/KMP/KMPPubNub+Publish.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,16 @@
// This source code is licensed under the license found in the
// LICENSE file in the root directory of this source tree.
//
// IMPORTANT NOTE FOR DEVELOPERS USING THIS SDK
//
// All public symbols in this file are intended to allow interoperation with Kotlin Multiplatform for other PubNub frameworks.
// While these symbols are public, they are intended strictly for internal usage.
//
// External developers should refrain from directly using these symbols in their code, as their implementation details
// may change in future versions of the framework, potentially leading to breaking changes.

import Foundation

/// IMPORTANT NOTE FOR DEVELOPERS USING THIS SDK
///
/// All public symbols in this file are intended to allow interoperation with Kotlin Multiplatform for other PubNub frameworks.
/// While these symbols are public, they are intended strictly for internal usage.
///
/// External developers should refrain from directly using these symbols in their code, as their implementation details
/// may change in future versions of the framework, potentially leading to breaking changes.

// MARK: - Publish

extension KMPPubNub {
Expand Down
15 changes: 7 additions & 8 deletions Sources/PubNub/KMP/KMPPubNub+Push.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,16 @@
// This source code is licensed under the license found in the
// LICENSE file in the root directory of this source tree.
//
// IMPORTANT NOTE FOR DEVELOPERS USING THIS SDK
//
// All public symbols in this file are intended to allow interoperation with Kotlin Multiplatform for other PubNub frameworks.
// While these symbols are public, they are intended strictly for internal usage.
//
// External developers should refrain from directly using these symbols in their code, as their implementation details
// may change in future versions of the framework, potentially leading to breaking changes.

import Foundation

/// IMPORTANT NOTE FOR DEVELOPERS USING THIS SDK
///
/// All public symbols in this file are intended to allow interoperation with Kotlin Multiplatform for other PubNub frameworks.
/// While these symbols are public, they are intended strictly for internal usage.
///
/// External developers should refrain from directly using these symbols in their code, as their implementation details
/// may change in future versions of the framework, potentially leading to breaking changes.

extension KMPPubNub {
func pushService(from rawString: String) -> PubNub.PushService? {
switch rawString {
Expand Down
15 changes: 7 additions & 8 deletions Sources/PubNub/KMP/KMPPubNub+Subscribe.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,16 @@
// This source code is licensed under the license found in the
// LICENSE file in the root directory of this source tree.
//
// IMPORTANT NOTE FOR DEVELOPERS USING THIS SDK
//
// All public symbols in this file are intended to allow interoperation with Kotlin Multiplatform for other PubNub frameworks.
// While these symbols are public, they are intended strictly for internal usage.
//
// External developers should refrain from directly using these symbols in their code, as their implementation details
// may change in future versions of the framework, potentially leading to breaking changes.

import Foundation

/// IMPORTANT NOTE FOR DEVELOPERS USING THIS SDK
///
/// All public symbols in this file are intended to allow interoperation with Kotlin Multiplatform for other PubNub frameworks.
/// While these symbols are public, they are intended strictly for internal usage.
///
/// External developers should refrain from directly using these symbols in their code, as their implementation details
/// may change in future versions of the framework, potentially leading to breaking changes.

// MARK: - Subscribed channels & channel groups

@objc
Expand Down
17 changes: 7 additions & 10 deletions Sources/PubNub/KMP/KMPPubNub+Time.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,16 @@
// This source code is licensed under the license found in the
// LICENSE file in the root directory of this source tree.
//
// IMPORTANT NOTE FOR DEVELOPERS USING THIS SDK
//
// All public symbols in this file are intended to allow interoperation with Kotlin Multiplatform for other PubNub frameworks.
// While these symbols are public, they are intended strictly for internal usage.
//
// External developers should refrain from directly using these symbols in their code, as their implementation details
// may change in future versions of the framework, potentially leading to breaking changes.

import Foundation

/// IMPORTANT NOTE FOR DEVELOPERS USING THIS SDK
///
/// All public symbols in this file are intended to allow interoperation with Kotlin Multiplatform for other PubNub frameworks.
/// While these symbols are public, they are intended strictly for internal usage.
///
/// External developers should refrain from directly using these symbols in their code, as their implementation details
/// may change in future versions of the framework, potentially leading to breaking changes.

// MARK: - Time

@objc
public extension KMPPubNub {
func time(
Expand Down
15 changes: 7 additions & 8 deletions Sources/PubNub/KMP/KMPPubNub.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,16 @@
// This source code is licensed under the license found in the
// LICENSE file in the root directory of this source tree.
//
// IMPORTANT NOTE FOR DEVELOPERS USING THIS SDK
//
// All public symbols in this file are intended to allow interoperation with Kotlin Multiplatform for other PubNub frameworks.
// While these symbols are public, they are intended strictly for internal usage.
//
// External developers should refrain from directly using these symbols in their code, as their implementation details
// may change in future versions of the framework, potentially leading to breaking changes..

import Foundation

/// IMPORTANT NOTE FOR DEVELOPERS USING THIS SDK
///
/// All public symbols in this file are intended to allow interoperation with Kotlin Multiplatform for other PubNub frameworks.
/// While these symbols are public, they are intended strictly for internal usage.
///
/// External developers should refrain from directly using these symbols in their code, as their implementation details
/// may change in future versions of the framework, potentially leading to breaking changes..

@objc
public class KMPPubNub: NSObject {
let pubnub: PubNub
Expand Down
Loading

0 comments on commit 73803fb

Please sign in to comment.