Skip to content

Commit 6937ec3

Browse files
committed
Fix SwiftLint warnings
1 parent 5c1b827 commit 6937ec3

File tree

4 files changed

+13
-12
lines changed

4 files changed

+13
-12
lines changed

.swiftlint.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ disabled_rules:
66
- cyclomatic_complexity
77
- variable_name
88
- type_name
9+
- todo
910

1011
shorthand_operator: warning
1112
superfluous_disable_command: warning

Sources/DispatchWatcher.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ open class DispatchFileSystemWatcher {
145145
// MARK: - Deinitialization
146146

147147
deinit {
148-
//print("\(path): Deinit")
148+
// print("\(path): Deinit")
149149
close()
150150
}
151151

@@ -217,7 +217,7 @@ open class DispatchFileSystemWatcher {
217217
// stop watching when path created
218218
if self?.path.isRegular == true || self?.path.isDirectoryFile == true {
219219
self?.dispatchDelegate(.Create)
220-
//self.delegate?.fsWatcherDidObserveCreate(self)
220+
// self.delegate?.fsWatcherDidObserveCreate(self)
221221
self?.createWatcher = nil
222222
self?.startWatching()
223223
watch.stopWatching()
@@ -245,13 +245,13 @@ open class DispatchFileSystemWatcher {
245245
}
246246

247247
// Define the block to call when a file change is detected.
248-
source!.setEventHandler { //[unowned self] () in
248+
source!.setEventHandler { // [unowned self] () in
249249
let eventType = DispatchFileSystemEvents(rawValue: self.source!.data)
250250
self.dispatchDelegate(eventType)
251251
}
252252

253253
// Define a cancel handler to ensure the path is closed when the source is cancelled.
254-
source!.setCancelHandler { //[unowned self] () in
254+
source!.setCancelHandler { // [unowned self] () in
255255
_ = Darwin.close(self.fileDescriptor)
256256
self.fileDescriptor = -1
257257
self.source = nil

Sources/FileSystemWatcher.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ public class FileSystemWatcher {
3535
// MARK: - Private Static Properties
3636

3737
/// The event stream callback for when events occur.
38-
private static let _eventCallback: FSEventStreamCallback = {
38+
private static let _eventCallback: FSEventStreamCallback = { // swiftlint:disable all
3939
(stream: ConstFSEventStreamRef,
40-
contextInfo: UnsafeMutableRawPointer?,
41-
numEvents: Int,
42-
eventPaths: UnsafeMutableRawPointer,
43-
eventFlags: UnsafePointer<FSEventStreamEventFlags>,
44-
eventIds: UnsafePointer<FSEventStreamEventId>) in
40+
contextInfo: UnsafeMutableRawPointer?,
41+
numEvents: Int,
42+
eventPaths: UnsafeMutableRawPointer,
43+
eventFlags: UnsafePointer<FSEventStreamEventFlags>,
44+
eventIds: UnsafePointer<FSEventStreamEventId>) in // swiftlint:enable all
4545

4646
FileSystemWatcher.log("Callback Fired")
4747

Sources/Path.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ public struct Path {
7070
weak var delegate: FileManagerDelegate?
7171
/// Safe way to use fileManager
7272
var fileManager: FileManager {
73-
//if delegate == nil {
73+
// if delegate == nil {
7474
// print("\n\nDelegate is nil\n\n")
75-
//}
75+
// }
7676
unsafeFileManager.delegate = delegate
7777
return unsafeFileManager
7878
}

0 commit comments

Comments
 (0)