Skip to content

Commit

Permalink
Fix SwiftLint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
e-marchand committed Feb 14, 2021
1 parent 5c1b827 commit 6937ec3
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
1 change: 1 addition & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ disabled_rules:
- cyclomatic_complexity
- variable_name
- type_name
- todo

shorthand_operator: warning
superfluous_disable_command: warning
Expand Down
8 changes: 4 additions & 4 deletions Sources/DispatchWatcher.swift
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ open class DispatchFileSystemWatcher {
// MARK: - Deinitialization

deinit {
//print("\(path): Deinit")
// print("\(path): Deinit")
close()
}

Expand Down Expand Up @@ -217,7 +217,7 @@ open class DispatchFileSystemWatcher {
// stop watching when path created
if self?.path.isRegular == true || self?.path.isDirectoryFile == true {
self?.dispatchDelegate(.Create)
//self.delegate?.fsWatcherDidObserveCreate(self)
// self.delegate?.fsWatcherDidObserveCreate(self)
self?.createWatcher = nil
self?.startWatching()
watch.stopWatching()
Expand Down Expand Up @@ -245,13 +245,13 @@ open class DispatchFileSystemWatcher {
}

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

// Define a cancel handler to ensure the path is closed when the source is cancelled.
source!.setCancelHandler { //[unowned self] () in
source!.setCancelHandler { // [unowned self] () in
_ = Darwin.close(self.fileDescriptor)
self.fileDescriptor = -1
self.source = nil
Expand Down
12 changes: 6 additions & 6 deletions Sources/FileSystemWatcher.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ public class FileSystemWatcher {
// MARK: - Private Static Properties

/// The event stream callback for when events occur.
private static let _eventCallback: FSEventStreamCallback = {
private static let _eventCallback: FSEventStreamCallback = { // swiftlint:disable all
(stream: ConstFSEventStreamRef,
contextInfo: UnsafeMutableRawPointer?,
numEvents: Int,
eventPaths: UnsafeMutableRawPointer,
eventFlags: UnsafePointer<FSEventStreamEventFlags>,
eventIds: UnsafePointer<FSEventStreamEventId>) in
contextInfo: UnsafeMutableRawPointer?,
numEvents: Int,
eventPaths: UnsafeMutableRawPointer,
eventFlags: UnsafePointer<FSEventStreamEventFlags>,
eventIds: UnsafePointer<FSEventStreamEventId>) in // swiftlint:enable all

FileSystemWatcher.log("Callback Fired")

Expand Down
4 changes: 2 additions & 2 deletions Sources/Path.swift
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ public struct Path {
weak var delegate: FileManagerDelegate?
/// Safe way to use fileManager
var fileManager: FileManager {
//if delegate == nil {
// if delegate == nil {
// print("\n\nDelegate is nil\n\n")
//}
// }
unsafeFileManager.delegate = delegate
return unsafeFileManager
}
Expand Down

0 comments on commit 6937ec3

Please sign in to comment.