OSDN Git Service

swiftlintに対応
authormasakih <masakih@users.sourceforge.jp>
Fri, 3 Nov 2017 07:14:46 +0000 (16:14 +0900)
committermasakih <masakih@users.sourceforge.jp>
Fri, 3 Nov 2017 07:14:46 +0000 (16:14 +0900)
KCD/Fleet.swift
KCD/FleetViewController.swift
KCD/GuardShelterCommand.swift
KCD/NSPredicateExtension.swift
KCD/ShipDetailViewController.swift
KCD/TSVSupport.swift

index 3b33413..4532234 100644 (file)
@@ -79,7 +79,7 @@ final class Fleet: NSObject {
     
     subscript(_ index: Int) -> Ship? { return deck?[index] }
     
-    override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) {
+    override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey: Any]?, context: UnsafeMutableRawPointer?) {
         
         if context == &pDeckContext {
             
index 3b06ccc..7ceafb4 100644 (file)
@@ -231,12 +231,12 @@ final class FleetViewController: NSViewController {
             sakutekiCalculator = Formula33(Int(factor))
         }
         
-        fleetController.bind(NSBindingName(#keyPath(NSArrayController.content)), to:self, withKeyPath:#keyPath(fleet), options:nil)
-        fleetController.addObserver(self, forKeyPath:"selection.name", context:nil)
+        fleetController.bind(NSBindingName(#keyPath(NSArrayController.content)), to: self, withKeyPath: #keyPath(fleet), options: nil)
+        fleetController.addObserver(self, forKeyPath: "selection.name", context: nil)
         shipKeys.forEach {
             
             let keyPath = "selection.\($0)"
-            fleetController.addObserver(self, forKeyPath:keyPath, context:&shipKeysContext)
+            fleetController.addObserver(self, forKeyPath: keyPath, context: &shipKeysContext)
         }
         
         buildAnchorageRepairHolder()
index cd31c35..0134ef4 100644 (file)
@@ -57,7 +57,7 @@ final class GuardShelterCommand: JSONCommand {
         let store = ServerDataStore.default
         
         switch damagedPos {
-        case 1...6: return store.deck(by: 1)?.shipId(of:damagedPos - 1)
+        case 1...6: return store.deck(by: 1)?.shipId(of: damagedPos - 1)
         case 7...12: return store.deck(by: 2)?.shipId(of: damagedPos - 6 - 1)
         default: return nil
         }
index 91c9f0e..fb2d0d3 100644 (file)
@@ -64,8 +64,8 @@ public extension NSPredicate {
         
         switch type {
         case .and: return NSCompoundPredicate(andPredicateWithSubpredicates: p)
-        case .or:  return NSCompoundPredicate(orPredicateWithSubpredicates:  p)
-        case .not: return NSCompoundPredicate(notPredicateWithSubpredicate:  self.compound(predicates: p))
+        case .or:  return NSCompoundPredicate(orPredicateWithSubpredicates: p)
+        case .not: return NSCompoundPredicate(notPredicateWithSubpredicate: self.compound(predicates: p))
         }
     }
 }
index d8bf5c7..21cf5b0 100644 (file)
@@ -148,7 +148,7 @@ final class ShipDetailViewController: NSViewController {
         
     }
     
-    override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) {
+    override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey: Any]?, context: UnsafeMutableRawPointer?) {
         
         if context == &shipContext {
             
index 6c8661b..6c3761d 100644 (file)
@@ -47,7 +47,6 @@ private struct LFSeparateLine {
     }
 }
 
-// swiftlint:disable type_body_length
 final class TSVSupport {
     
     private let store = LocalDataStore.oneTimeEditor()