diff --git a/StorageCleaner/Sources/CleanUpConstraint/ExactStorageSpaceAvailabilityConstraint.swift b/StorageCleaner/Sources/CleanUpConstraint/ExactStorageSpaceAvailabilityConstraint.swift index 839976e..0bedd6f 100644 --- a/StorageCleaner/Sources/CleanUpConstraint/ExactStorageSpaceAvailabilityConstraint.swift +++ b/StorageCleaner/Sources/CleanUpConstraint/ExactStorageSpaceAvailabilityConstraint.swift @@ -13,9 +13,9 @@ import Foundation /// - The spaceInPercentage is passed as 512 * 1024 * 1024 representing 512 MB of storage /// - Then when isMet() is call it will yield true /// - If the Free Space is now 500 MB -/// - It will again yeild true +/// - It will again yield true /// - if the Free Space is now 513 MB -/// - It will yeild false +/// - It will yield false public final class ExactStorageSpaceAvailabilityConstraint: CleanUpConstraint { /// Comparitor of spaceInPercentage against availableSpaceInPercentage you can either pass and closure with float compared with float or you could pass any boolean operation like <=, >=, <,> as comparitors diff --git a/StorageCleaner/Sources/CleanUpConstraint/PercentageStorageSpaceAvailabilityConstraint.swift b/StorageCleaner/Sources/CleanUpConstraint/PercentageStorageSpaceAvailabilityConstraint.swift index 7691b3a..b9b8b46 100644 --- a/StorageCleaner/Sources/CleanUpConstraint/PercentageStorageSpaceAvailabilityConstraint.swift +++ b/StorageCleaner/Sources/CleanUpConstraint/PercentageStorageSpaceAvailabilityConstraint.swift @@ -13,9 +13,9 @@ import Foundation /// - The spaceInPercentage is passed as 0.25 representing 25% of storage /// - Then when isMet() is call it will yield true /// - If the Free Space is now 24 GB -/// - It will again yeild true +/// - It will again yield true /// - if the Free Space is now 26 GB -/// - It will yeild false +/// - It will yield false public final class PercentageStorageSpaceAvailabilityConstraint: CleanUpConstraint { /// Comparitor of spaceInPercentage against availableSpaceInPercentage you can either pass and closure with float compared with float or you could pass any boolean operation like <=, >=, <,> as comparitors diff --git a/StorageCleaner/Sources/Config/StorageCleanerConfig.swift b/StorageCleaner/Sources/Config/StorageCleanerConfig.swift index 09abc6d..b85b2bf 100644 --- a/StorageCleaner/Sources/Config/StorageCleanerConfig.swift +++ b/StorageCleaner/Sources/Config/StorageCleanerConfig.swift @@ -53,7 +53,7 @@ public protocol StorageCleanerConfig { /// This `Int64` value represents that limit (in bytes). var cacheDirSizeLimitInBytes: Int64 { get set } - /// Interval in secods for periodic cleanup + /// Interval in seconds for periodic cleanup var cleanUpInterval: TimeInterval { get set } } diff --git a/StorageCleaner/Sources/Config/StorageCleanerConfiguration.swift b/StorageCleaner/Sources/Config/StorageCleanerConfiguration.swift index dbb66d8..4f04223 100644 --- a/StorageCleaner/Sources/Config/StorageCleanerConfiguration.swift +++ b/StorageCleaner/Sources/Config/StorageCleanerConfiguration.swift @@ -21,7 +21,7 @@ public struct StorageCleanerDefaultConfig { public static let cleanUpInterval: TimeInterval = 2 * 24 * 60 * 60 } -/// Represets default concrete implementation of ``StorageCleanerConfig`` +/// Represents default concrete implementation of ``StorageCleanerConfig`` public struct StorageCleanerConfiguration: StorageCleanerConfig { public var isEnabled: Bool = true diff --git a/StorageCleaner/Sources/DiskSpaceProvider.swift b/StorageCleaner/Sources/DiskSpaceProvider.swift index 092ff97..f1850d4 100644 --- a/StorageCleaner/Sources/DiskSpaceProvider.swift +++ b/StorageCleaner/Sources/DiskSpaceProvider.swift @@ -27,7 +27,7 @@ public class DiskSpaceProvider { return space ?? 0 } - /// Fetch the available according to provided usage tyep + /// Fetch the available according to provided usage type /// - Parameter usageType: usage type of disk space /// - Returns: returns size public func getFreeDiskSpace(forUsageType usageType: UsageType) throws -> Int64 { @@ -45,7 +45,7 @@ public class DiskSpaceProvider { return size ?? 0 } - /// Get free disk space irrelevent to usage type iOS 13 prior API + /// Get free disk space irrelevant to usage type iOS 13 prior API /// - Returns: returns size public func getFreeDiskSpace() throws -> Int64 { let systemAttributes = try FileManager.default.attributesOfFileSystem(forPath: homeDirectoryPath) diff --git a/StorageCleaner/Sources/Extensions/URL+.swift b/StorageCleaner/Sources/Extensions/URL+.swift index 2073706..2415ab2 100644 --- a/StorageCleaner/Sources/Extensions/URL+.swift +++ b/StorageCleaner/Sources/Extensions/URL+.swift @@ -14,7 +14,7 @@ enum FileTypeError: Error { extension URL { - /// Return the size of content at url, it can be file size or diretory's meta data size + /// Return the size of content at url, it can be file size or directory's meta data size /// - Returns: size of content in bytes func getSizeOfContent() -> Int64 { let size = try? FileManager.default.attributesOfItem(atPath: path)[.size] as? NSNumber @@ -23,7 +23,7 @@ extension URL { } /// Returns last access date of that - /// - Returns: Date when the file assicoated with the url was last accessed + /// - Returns: Date when the file associated with the url was last accessed func getLastAccessDate() -> Date? { let resourceValues = try? resourceValues(forKeys: [.contentAccessDateKey]) return resourceValues?.contentAccessDate diff --git a/StorageCleaner/Sources/ItemRemovalResult.swift b/StorageCleaner/Sources/ItemRemovalResult.swift index 3d28048..d1d87b7 100644 --- a/StorageCleaner/Sources/ItemRemovalResult.swift +++ b/StorageCleaner/Sources/ItemRemovalResult.swift @@ -13,17 +13,17 @@ public class ItemRemovalResult { public var freedSpaceInBytes: Int64 /// Space that was not able to be free after cleanup due to some errors in byte public var unremovedItemsSpaceInBytes: Int64 - /// URL's set that were succesfully removed + /// URL's set that were successfully removed public var removedItemUris: Set - /// URL to error map for file that was not able to deleted due to errors + /// URL to error map for file that was not able to be deleted due to errors public var unremovedItems: [URL: Error] /// Creates ItemRemovalResult with provided attributes /// - Parameters: /// - freedSpaceInBytes: Space free by cleaner in bytes /// - unremovedItemsSpaceInBytes: Space that was not able to be free after cleanup due to some errors in byte - /// - removedItemUris: URL's set that were succesfully removed - /// - unremovedItems: URL to error map for file that was not able to deleted due to errors + /// - removedItemUris: URL's set that were successfully removed + /// - unremovedItems: URL to error map for file that was not able to be deleted due to errors public init( freedSpaceInBytes: Int64, unremovedItemsSpaceInBytes: Int64, diff --git a/StorageCleaner/Sources/RemovableItems/RemovableFiles.swift b/StorageCleaner/Sources/RemovableItems/RemovableFiles.swift index a1094f9..3ad81ec 100644 --- a/StorageCleaner/Sources/RemovableItems/RemovableFiles.swift +++ b/StorageCleaner/Sources/RemovableItems/RemovableFiles.swift @@ -13,7 +13,7 @@ public final class RemovableFiles: RemovableItems { /// Urls of files var fileURls: [URL] - /// Count of elligible files + /// Count of eligible files public var count: Int { fileURls.count } lazy public var sizeInBytes: Int64 = { return fileURls.reduce(0) { partialResult, url -> Int64 in @@ -60,8 +60,8 @@ public final class RemovableFiles: RemovableItems { return commit(shouldActuallyDelete: false) } - /// Deletes the file depending on `shouldActuallyDelete` vauleu and genrates the removal result - /// - Parameter shouldActuallyDelete: if the action should commited or should just calculate the size that could have freed if deleted + /// Deletes the file depending on `shouldActuallyDelete` value and generates the removal result + /// - Parameter shouldActuallyDelete: if the action should committed or should just calculate the size that could have freed if deleted /// - Returns: removal result func commit(shouldActuallyDelete: Bool) -> ItemRemovalResult { var removedUrls = Set() diff --git a/StorageCleaner/Sources/StorageCleanerResultReceiver/AnalyticsResultReceiver.swift b/StorageCleaner/Sources/StorageCleanerResultReceiver/AnalyticsResultReceiver.swift index 6b8d084..300121a 100644 --- a/StorageCleaner/Sources/StorageCleanerResultReceiver/AnalyticsResultReceiver.swift +++ b/StorageCleaner/Sources/StorageCleanerResultReceiver/AnalyticsResultReceiver.swift @@ -8,7 +8,7 @@ import Foundation -/// AnalyticsResultReceiver is StorageCleanerResultReceiver's concerete implementation which is responsible to report removal result data points to provided performance tracker +/// AnalyticsResultReceiver is StorageCleanerResultReceiver's concrete implementation which is responsible to report removal result data points to provided performance tracker public final class AnalyticsResultReceiver: StorageCleanerResultReceiver { private let storageCleanerTrackingKey = "Disk Cleaner" @@ -22,8 +22,8 @@ public final class AnalyticsResultReceiver: StorageCleanerResultReceiver { /// AnalyticsResultReceiver init /// - /// AnalyticsResultReceiver is StorageCleanerResultReceiver's concerete implementation which is responsible to report removal result data points to provided performance tracker - /// - Parameter performanceTracker: performace tracker where the perfomance metric should be reported to + /// AnalyticsResultReceiver is StorageCleanerResultReceiver's concrete implementation which is responsible to report removal result data points to provided performance tracker + /// - Parameter performanceTracker: performance tracker where the performance metric should be reported to public init?(performanceTracker: PerformanceTracker?, attributesMapProvider: (() -> [String: String])? = nil) { guard let performanceTracker = performanceTracker else { return nil diff --git a/StorageCleaner/Sources/StorageCleanerWorker.swift b/StorageCleaner/Sources/StorageCleanerWorker.swift index c438285..b414ed2 100644 --- a/StorageCleaner/Sources/StorageCleanerWorker.swift +++ b/StorageCleaner/Sources/StorageCleanerWorker.swift @@ -22,8 +22,8 @@ public class StorageCleanerWorker { /// Creates PercentageStorageSpaceAvailabilityConstraint /// - Parameters: - /// - config: StorageCleanerConfig comforming object - /// - performanceTracker: PerformanceTracker comforming object + /// - config: StorageCleanerConfig conforming object + /// - performanceTracker: PerformanceTracker conforming object /// - cacheRootDirectory: optional cacheRootDirectory description public init( config: StorageCleanerConfig, @@ -45,7 +45,7 @@ public class StorageCleanerWorker { .appendingPathComponent("fsCachedData") } - // Exclude the designated file from rempvable items list + // Exclude the designated file from removable items list private func excludingFilesFilter(_ file: URL) -> Bool { return excludedFileList.contains(file.lastPathComponent) == false } @@ -73,7 +73,7 @@ public class StorageCleanerWorker { diskSpaceProvider: diskSpaceProvider ), - // This envelopes get asked for removable items if the above contraint is met, this envelop contains sub envelop and when the removable item is called upon this it merges the result from sub enveloped + // This envelopes get asked for removable items if the above constraint is met, this envelop contains sub envelop and when the removable item is called upon this it merges the result from sub enveloped delegate: StorageEnvelopes( // This envelop fetches the stale files which are not used in the a set time duration @@ -83,7 +83,7 @@ public class StorageCleanerWorker { thresholdTimeInterval: config.cacheFileAgeLimitInTimeInterval ), - // This constraint only allows call to delegate evenloe if the current avaiaable space is <= to the space in byte provided + // This constraint only allows call to delegate envelope if the current available space is <= to the space in byte provided ConstrainedEnvelopeProxy( constraint: ExactStorageSpaceAvailabilityConstraint( comparator: <=, diff --git a/StorageCleaner/Sources/StorageEnvelope/DirectoryEnvelope.swift b/StorageCleaner/Sources/StorageEnvelope/DirectoryEnvelope.swift index 163d8d3..a55d94c 100644 --- a/StorageCleaner/Sources/StorageEnvelope/DirectoryEnvelope.swift +++ b/StorageCleaner/Sources/StorageEnvelope/DirectoryEnvelope.swift @@ -7,10 +7,10 @@ import Foundation -/// Directory Enveloper is responsible to collect removable files from provioded directory +/// Directory Enveloper is responsible to collect removable files from provided directory public final class DirectoryEnvelope: StorageEnvelope { - /// Directory to fetchf file from, this directory is traversed in depth first fashion so the file included are also from relative subdirectories + /// Directory to fetch file from, this directory is traversed in depth first fashion so the file included are also from relative subdirectories private var directoryURL: URL /// File fileter to apply on collected file private var filter: FileFilter? = nil @@ -21,7 +21,7 @@ public final class DirectoryEnvelope: StorageEnvelope { /// Creates a new DirectoryEnvelope /// - Parameters: - /// - directoryURL: Directory to fetchf file from, this directory is traversed in depth first fashion so the file included are also from relative subdirectories + /// - directoryURL: Directory to fetch file from, this directory is traversed in depth first fashion so the file included are also from relative subdirectories /// - filter: File fileter to apply on collected file /// - fileComparator: File comparitor to sort the files /// - sizeLimitInBytes: Size limit to trim the file limit diff --git a/StorageCleaner/Sources/StorageEnvelope/LegacyStaleFilesEnvelope.swift b/StorageCleaner/Sources/StorageEnvelope/LegacyStaleFilesEnvelope.swift index f9281f8..b89ea87 100644 --- a/StorageCleaner/Sources/StorageEnvelope/LegacyStaleFilesEnvelope.swift +++ b/StorageCleaner/Sources/StorageEnvelope/LegacyStaleFilesEnvelope.swift @@ -54,7 +54,7 @@ public final class LegacyStaleFilesEnvelope: StorageEnvelope { return files } - /// Checks the last accessed time vs the current time time diffrence and compare that with provided time interval to check if the file is stale + /// Checks the last accessed time vs the current time time difference and compare that with provided time interval to check if the file is stale /// - Parameter fileURL: url of file /// - Returns: returns true if file is stale otherwise false private func isStale(_ fileURL: URL) -> Bool {