From 4da54afe932cd2c9386fac07d7f9986f034b65a3 Mon Sep 17 00:00:00 2001 From: eonist <30n1st@gmail.com> Date: Sun, 15 Oct 2023 14:08:06 +0200 Subject: [PATCH] Lint --- Package.swift | 2 +- Sources/FileSugar/FileAsserter.swift | 4 ++-- Sources/FileSugar/FileUtils.swift | 2 +- Sources/FileSugar/common/String+Extension.swift | 4 ++-- Sources/FileSugar/path/FilePathAsserter.swift | 6 +++--- Sources/FileSugar/path/FilePathParser.swift | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Package.swift b/Package.swift index 413fe9a..b2d2abd 100644 --- a/Package.swift +++ b/Package.swift @@ -19,4 +19,4 @@ let package = Package( name: "FileSugarTests", // The name of the test target dependencies: ["FileSugar"]) // The dependencies of the test target ] -) \ No newline at end of file +) diff --git a/Sources/FileSugar/FileAsserter.swift b/Sources/FileSugar/FileAsserter.swift index 1a05c5b..725fca2 100755 --- a/Sources/FileSugar/FileAsserter.swift +++ b/Sources/FileSugar/FileAsserter.swift @@ -14,7 +14,7 @@ public final class FileAsserter { // Check if a file exists at the given path .fileExists(atPath: path) } - + /** * Asserts if a directory has files * ## Examples: @@ -28,4 +28,4 @@ public final class FileAsserter { // Check if the returned content is empty .isEmpty ?? false } -} \ No newline at end of file +} diff --git a/Sources/FileSugar/FileUtils.swift b/Sources/FileSugar/FileUtils.swift index a451726..00a2be4 100755 --- a/Sources/FileSugar/FileUtils.swift +++ b/Sources/FileSugar/FileUtils.swift @@ -17,4 +17,4 @@ class FileUtils { NSWorkspace.shared.selectFile(nil, inFileViewerRootedAtPath: expandedFilePath) } } -#endif \ No newline at end of file +#endif diff --git a/Sources/FileSugar/common/String+Extension.swift b/Sources/FileSugar/common/String+Extension.swift index b5d3560..2443ba9 100644 --- a/Sources/FileSugar/common/String+Extension.swift +++ b/Sources/FileSugar/common/String+Extension.swift @@ -4,8 +4,8 @@ extension String { /** * From user agnostic to absolute URL */ - internal var tildePath: String { + internal var tildePath: String { // Convert the string to an NSString and expand the tilde in the path - NSString(string: self).expandingTildeInPath + NSString(string: self).expandingTildeInPath } } diff --git a/Sources/FileSugar/path/FilePathAsserter.swift b/Sources/FileSugar/path/FilePathAsserter.swift index e8551ca..4841f6b 100755 --- a/Sources/FileSugar/path/FilePathAsserter.swift +++ b/Sources/FileSugar/path/FilePathAsserter.swift @@ -10,7 +10,7 @@ public final class FilePathAsserter { public static func isAbsolute(_ path: String, pathSeperator: String = "/") -> Bool { path.hasPrefix(pathSeperator) // Check if the path starts with the path separator } - + /** * Tests if a path contains a relative path (i.e. "../") * - Parameter path: The path to test @@ -29,7 +29,7 @@ public final class FilePathAsserter { // Check if the path starts with the path separator or "../" path.hasPrefix(pathSeperator) || path.hasPrefix(".." + pathSeperator) } - + /** * Tests if a path is a tilde path (i.e. starts with "~") * - Parameter path: The path to test @@ -38,4 +38,4 @@ public final class FilePathAsserter { public static func isTildePath(_ path: String) -> Bool { path.hasPrefix("~") // Check if the path starts with "~" } -} \ No newline at end of file +} diff --git a/Sources/FileSugar/path/FilePathParser.swift b/Sources/FileSugar/path/FilePathParser.swift index 37b879b..1a2df65 100755 --- a/Sources/FileSugar/path/FilePathParser.swift +++ b/Sources/FileSugar/path/FilePathParser.swift @@ -84,7 +84,7 @@ public final class FilePathParser { public static func fileName(path filePath: String, withExtension: Bool = true) -> String? { guard let url: URL = path(filePath) else { return nil } // Get the URL from the file path return fileName(url, withExtension) // Get the file name from the URL and return it - } + } /** * Returns the directory of the given file URL. *