Skip to content
Closed

Lint #227

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ let package = Package(
.package(url: "https://github.com/SwiftyJSON/SwiftyJSON", .upToNextMajor(from: "5.0.2")),
.package(url: "https://github.com/yahoojapan/SwiftyXMLParser", .upToNextMajor(from: "5.6.0")),
.package(url: "https://github.com/twostraws/CodeScanner.git", .upToNextMajor(from: "2.5.2")),
.package(url: "https://github.com/SimplyDanny/SwiftLintPlugins", from: "0.63.2"),
.package(url: "https://github.com/SimplyDanny/SwiftLintPlugins", from: "0.63.3"),
],
targets: [
.target(
Expand Down
2 changes: 1 addition & 1 deletion Sources/NextcloudKit/Log/NKLog.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,6 @@ public func nkLog(cancel message: String, minimumLogLevel: NKLogLevel = .compact
/// - minimumLogLevel: set the minimun level for write the message
/// - consoleOnly: if true write the messa only in console
@inlinable
public func nkLog(tag: String, emoji: NKLogTagEmoji = .debug, message: String, minimumLogLevel: NKLogLevel = .compact, consoleOnly: Bool = false) {
public func nkLog(tag: String, emoji: NKLogTagEmoji = .debug, message: String, minimumLogLevel: NKLogLevel = .compact, consoleOnly: Bool = false) {
NKLogFileManager.shared.writeLog(tag: tag, emoji: emoji, message: message, minimumLogLevel: minimumLogLevel, consoleOnly: consoleOnly)
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,3 @@ public class NKTextProcessingTaskType {
return TaskTypes(types: types)
}
}


1 change: 0 additions & 1 deletion Sources/NextcloudKit/Models/Assistant/v2/TaskTypes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ public struct TaskTypes: Codable {
public struct TaskTypeData: Codable {
public typealias TaskInputShape = [String: Shape]
public typealias TaskOutputShape = [String: Shape]

public var id: String?
public let name: String?
public let description: String?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,3 @@ public struct ContextMenuAction: Codable {
case mimetypeFilters = "mimetype_filters"
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public enum NKEditorDetailsConverter {
if NKLogFileManager.shared.logLevel == .verbose {
data.printJson()
}

return (editors, creators)
}
}
8 changes: 6 additions & 2 deletions Sources/NextcloudKit/Models/NKDataFileXML.swift
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,11 @@ public class NKDataFileXML: NSObject {
return xml["ocs", "data", "apppassword"].text
}

func convertDataFile(xmlData: Data, nkSession: NKSession, rootFileName: String, showHiddenFiles: Bool, includeHiddenFiles: [String]) async -> [NKFile] {
func convertDataFile(xmlData: Data,
nkSession: NKSession,
rootFileName: String,
showHiddenFiles: Bool,
includeHiddenFiles: [String]) async -> [NKFile] {
var files: [NKFile] = []
let rootFiles = "/" + nkSession.dav + "/files/"
guard let baseUrl = self.nkCommonInstance.getHostName(urlString: nkSession.urlBase) else {
Expand Down Expand Up @@ -333,7 +337,7 @@ public class NKDataFileXML: NSObject {
let propstat = element["d:propstat"][0]

if let getlastmodified = propstat["d:prop", "d:getlastmodified"].text,
let date = getlastmodified.parsedDate(using: "EEE, dd MMM y HH:mm:ss zzz") {
let date = getlastmodified.parsedDate(using: "EEE, dd MMM y HH:mm:ss zzz") {
file.date = date
}

Expand Down
6 changes: 0 additions & 6 deletions Sources/NextcloudKit/Models/NKDownloadLimit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,4 @@ public struct NKDownloadLimit: Sendable {
/// The token identifying the related share.
///
public let token: String

init(count: Int, limit: Int, token: String) {
self.count = count
self.limit = limit
self.token = token
}
}
2 changes: 1 addition & 1 deletion Sources/NextcloudKit/Models/NKFile.swift
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ public struct NKFile: Sendable {
livePhotoFile: String = "",
isFlaggedAsLivePhotoByServer: Bool = false,
datePhotosOriginal: Date? = nil,
exifPhotos: [[String : String?]] = .init(),
exifPhotos: [[String: String?]] = .init(),
placePhotos: String? = nil,
typeIdentifier: String = "") {

Expand Down
12 changes: 6 additions & 6 deletions Sources/NextcloudKit/NKCommon.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ public protocol NextcloudKitDelegate: AnyObject, Sendable {

func downloadingFinish(_ session: URLSession, downloadTask: URLSessionDownloadTask, didFinishDownloadingTo location: URL)

func downloadComplete(fileName: String, serverUrl: String, allHeaderFields: [AnyHashable : Any]?, task: URLSessionTask, error: NKError)
func uploadComplete(fileName: String, serverUrl: String, allHeaderFields: [AnyHashable : Any]?, task: URLSessionTask, error: NKError)
func downloadComplete(fileName: String, serverUrl: String, allHeaderFields: [AnyHashable: Any]?, task: URLSessionTask, error: NKError)
func uploadComplete(fileName: String, serverUrl: String, allHeaderFields: [AnyHashable: Any]?, task: URLSessionTask, error: NKError)
}

public extension NextcloudKitDelegate {
func authenticationChallenge(_ session: URLSession, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) { }
func authenticationChallenge(_ session: URLSession, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping @Sendable (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) { }
func urlSessionDidFinishEvents(forBackgroundURLSession session: URLSession) { }

func networkReachabilityObserver(_ typeReachability: NKTypeReachability) { }
Expand All @@ -43,8 +43,8 @@ public extension NextcloudKitDelegate {

func downloadingFinish(_ session: URLSession, downloadTask: URLSessionDownloadTask, didFinishDownloadingTo location: URL) { }

func downloadComplete(fileName: String, serverUrl: String, allHeaderFields: [AnyHashable : Any]?, task: URLSessionTask, error: NKError) { }
func uploadComplete(fileName: String, serverUrl: String, allHeaderFields: [AnyHashable : Any]?, task: URLSessionTask, error: NKError) { }
func downloadComplete(fileName: String, serverUrl: String, allHeaderFields: [AnyHashable: Any]?, task: URLSessionTask, error: NKError) { }
func uploadComplete(fileName: String, serverUrl: String, allHeaderFields: [AnyHashable: Any]?, task: URLSessionTask, error: NKError) { }
}

public struct NKCommon: Sendable {
Expand Down Expand Up @@ -98,7 +98,7 @@ public struct NKCommon: Sendable {
fileName: String,
chunkSize: Int,
filesChunk: [(fileName: String, size: Int64)],
chunkProgressHandler: @escaping (_ total: Int, _ counter: Int) -> Void = { _, _ in }) async throws -> [(fileName: String, size: Int64)] {
chunkProgressHandler: @escaping @Sendable (_ total: Int, _ counter: Int) -> Void = { _, _ in }) async throws -> [(fileName: String, size: Int64)] {
// If caller already has chunk list, recompute incremental sizes from disk and return.
if !filesChunk.isEmpty {
var recomputed: [(fileName: String, size: Int64)] = []
Expand Down
2 changes: 1 addition & 1 deletion Sources/NextcloudKit/NKInterceptor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ final class NKInterceptor: RequestInterceptor, Sendable {
self.nkCommonInstance = nkCommonInstance
}

func adapt(_ urlRequest: URLRequest, for session: AssistantSession, completion: @escaping (Result<URLRequest, Error>) -> Void) {
func adapt(_ urlRequest: URLRequest, for session: AssistantSession, completion: @escaping @Sendable (Result<URLRequest, Error>) -> Void) {
// Log request URL in verbose mode
if NKLogFileManager.shared.logLevel == .verbose,
let url = urlRequest.url?.absoluteString {
Expand Down
1 change: 0 additions & 1 deletion Sources/NextcloudKit/NKOperationHandle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,3 @@ public actor NKOperationHandle {
return request != nil || task != nil
}
}

Loading
Loading