OSDN Git Service

return文の前に改行を入れるようにした
authormasakih <masakih@users.sourceforge.jp>
Tue, 10 Apr 2018 13:35:04 +0000 (22:35 +0900)
committermasakih <masakih@users.sourceforge.jp>
Tue, 10 Apr 2018 13:35:04 +0000 (22:35 +0900)
51 files changed:
.swiftlint.yml
EquipmentEnhancementListBuilder/main.swift
KCD.xcodeproj/xcuserdata/masaki.xcuserdatad/xcschemes/KCD.xcscheme
KCD/API.swift
KCD/AirBase.swift
KCD/AirBasePlaneInfo.swift
KCD/AppDelegate.swift
KCD/ApplicationDirecrories.swift
KCD/Basic.swift
KCD/BroserWindowController.swift
KCD/CacheStoragePolicy.swift
KCD/ChangeHenseiCommand.swift
KCD/CommandRegister.swift
KCD/CoreDataProviderExtension.swift
KCD/DamageCalculator.swift
KCD/DamageValueTransformer.swift
KCD/DamageView.swift
KCD/Debug.swift
KCD/Deck.swift
KCD/DefaultKeyExtendedValues.swift
KCD/ExternalBrowserWindowController.swift
KCD/GameViewController.swift
KCD/GuardShelterCommand.swift
KCD/HistoryTableViewController.swift
KCD/KenzoDock.swift
KCD/KenzoMark.swift
KCD/MasterFurniture.swift
KCD/MasterMapInfo.swift
KCD/MasterMission.swift
KCD/MasterShip.swift
KCD/MasterSlotItem.swift
KCD/MasterSlotItemEquipType.swift
KCD/MasterUseItem.swift
KCD/NyukyoDock.swift
KCD/Quest.swift
KCD/ResourceHistoryManager.swift
KCD/ScreenshotEditorViewController.swift
KCD/Ship.swift
KCD/ShipMapper.swift
KCD/ShipViewController.swift
KCD/SlotItem.swift
KCD/SlotItemWindowController.swift
KCD/StoreCreateSlotItemHistoryCommand.swift
KCD/StrengthenListItem.swift
KCD/StrengthenListItemCellView.swift
KCD/StrengthenListViewController.swift
KCD/TSVSupport.swift
KCD/TiledImageView.swift
KCD/WindowManager.swift
KCDTests/GuardEscapeTest.swift
KCDTests/NormalBattleTest.swift

index d9d50c3..77a0cb5 100644 (file)
@@ -51,7 +51,11 @@ custom_rules:
         use_nsmanagedobjectcontext:
                 excluded: "ServerDataStore|ResourceHistoryDataStore|LocalDataStore|TemporaryDataStore|BookmarkDataStore|CoreDataManager|CoreDataCore|MOCGenerator"
                 name: "Positive using NSManagedObjectContext"
-                regex: "NSManagedObjectContext\\s"
+                regex: 'NSManagedObjectContext\s'
                 severity: error
         private_iboutlet:
-                regex: "@IBOutlet\\s+(?!private[(\\s])"
\ No newline at end of file
+                regex: '@IBOutlet\s+(?!private[(\s])'
+        blank_before_return:
+                name: "Needs blank bfore return"
+                regex: '\S+\R[ \t]*return'
+                severity: error
\ No newline at end of file
index 6037062..d40fe90 100644 (file)
@@ -86,12 +86,14 @@ private extension EnhancementListItem {
         guard line.count == 6 else {
             
             print("count not 6")
+            
             return nil
         }
         
         guard let i = equSets.index(where: { $0.identifier == line[0] }) else {
             
             print("Do not find \(line[0]) in EnhancementListItem.txt")
+            
             return nil
         }
         
@@ -126,6 +128,7 @@ func loadFile(path: String) -> String? {
     } catch {
         
         print("Can not create String from \(path)")
+        
         return nil
     }
 }
@@ -148,7 +151,9 @@ let requiredEquipmentSet = requiredEquipmentSetText
     .components(separatedBy: "\n")
     .map { TabSeparatedLine(value: $0) }
     .flatMap { (line: TabSeparatedLine) -> ThreeItemsQueue<TabSeparatedLine> in
+        
         threeLines.push(item: line)
+        
         return threeLines
     }
     .map { generate(threeLines: $0) }
index 371f10d..cc035f3 100644 (file)
@@ -62,6 +62,7 @@
       buildConfiguration = "Debug"
       selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
       selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+      codeCoverageEnabled = "YES"
       shouldUseLaunchSchemeArgsEnv = "YES">
       <Testables>
          <TestableReference
index b97a6c0..25300da 100644 (file)
@@ -136,9 +136,11 @@ private func apiType(of endpoint: Endpoint) -> APIType {
     switch endpoint {
         
     case .port:
+        
         return .port
         
     case .deck, .deckPort, .presetSelect:
+        
         return .deck
         
     case .battle,
@@ -148,18 +150,23 @@ private func apiType(of endpoint: Endpoint) -> APIType {
          .airBattle, .ldAirBattle, .combinedLdAirBattle,
          .midnightBattle, .midnightSpMidnight,
          .combinedMidnightBattle, .combinedEcMidnightBattle, .combinedSpMidnight:
+        
         return .battle
         
     case .battleResult, .combinedBattleResult:
+        
         return .battleResult
         
     case .goback, .gobakAlone:
+        
         return .guardEscape
         
     case .start, .next:
+        
         return .map
         
     default:
+        
         return .other
         
     }
index 48b60d8..cae7e03 100644 (file)
@@ -8,7 +8,7 @@
 
 import Foundation
 
-// swiftlint:disable variable_name
+// swiftlint:disable identifier_name
 final class AirBase: KCManagedObject {
     
     @NSManaged var rid: Int
index aadba42..a8991a4 100644 (file)
@@ -9,7 +9,7 @@
 import Foundation
 import CoreData
 
-// swiftlint:disable variable_name
+// swiftlint:disable identifier_name
 final class AirBasePlaneInfo: KCManagedObject {
     
     @NSManaged var squadron_id: Int
index 253a40e..e069ab2 100644 (file)
@@ -13,8 +13,7 @@ final class AppDelegate: NSObject {
     
     static var shared: AppDelegate {
         
-        // swiftlint:disable:next force_cast
-        return NSApplication.shared.delegate as! AppDelegate
+        return NSApplication.shared.delegate as! AppDelegate    // swiftlint:disable:this force_cast
     }
         
     let appNameForUserAgent: String = "KCD(1.9b36) is not Safari/604.4.7"
@@ -44,9 +43,11 @@ final class AppDelegate: NSObject {
     var screenShotSaveDirectory: String {
         
         get {
+            
             return UserDefaults.standard[.screenShotSaveDirectory] ?? ApplicationDirecrories.pictures.path
         }
         set {
+            
             UserDefaults.standard[.screenShotSaveDirectory] = newValue
         }
     }
@@ -251,12 +252,15 @@ extension AppDelegate {
             return true
             
         case #selector(AppDelegate.removeDatabaseFile(_:)):
+            
             return true
             
         case #selector(openInDeckBuilder(_:)):
+            
             return true
             
         default:
+            
             return windowManager.validateMenuItem(menuItem)
         }
     }
index acdf279..df6aef3 100644 (file)
@@ -64,12 +64,14 @@ extension ApplicationDirecrories {
             } else if !isDir.boolValue {
                 
                 print("\(url) is regular file, not direcory.")
+                
                 return parentURL
             }
             
         } catch {
             
             print("Can not create screenshot save directory.")
+            
             return parentURL
         }
         
index 4444f75..64ee85a 100644 (file)
@@ -8,7 +8,7 @@
 
 import Foundation
 
-// swiftlint:disable variable_name
+// swiftlint:disable identifier_name
 final class Basic: KCManagedObject {
     
     @NSManaged var active_flag: NSNumber?
index 6ffff31..14bd65a 100644 (file)
@@ -351,33 +351,47 @@ extension BroserWindowController {
             return true
             
         case #selector(BroserWindowController.fleetListAbove(_:)):
+            
             menuItem.state = (fleetViewPosition == .above ? .on : .off)
+            
             return true
             
         case #selector(BroserWindowController.fleetListBelow(_:)):
+            
             menuItem.state = (fleetViewPosition == .below ? .on : .off)
+            
             return true
             
         case #selector(BroserWindowController.fleetListDivide(_:)):
+            
             menuItem.state = (fleetViewPosition == .divided ? .on : .off)
+            
             return true
             
         case #selector(BroserWindowController.fleetListSimple(_:)):
+            
             menuItem.state = (fleetViewPosition == .oldStyle ? .on : .off)
+            
             return true
             
         case #selector(BroserWindowController.reorderToDoubleLine(_:)):
+            
             menuItem.state = (fleetViewController.shipOrder == .doubleLine ? .on : .off)
+            
             return true
             
         case #selector(BroserWindowController.reorderToLeftToRight(_:)):
+            
             menuItem.state = (fleetViewController.shipOrder == .leftToRight ? .on: .off)
+            
             return true
             
         case #selector(BroserWindowController.clearQuestList(_:)):
+            
             return true
             
         case #selector(BroserWindowController.showHideCombinedView(_:)):
+            
             if isCombinedMode {
                 
                 menuItem.title = LocalizedStrings.hideCombinedView.string
@@ -392,12 +406,15 @@ extension BroserWindowController {
             return true
             
         case #selector(BroserWindowController.toggleAnchorageSize(_:)):
+            
             return true
             
         case #selector(BroserWindowController.changeSakutekiCalculator(_:)):
+            
             return fleetViewController.validateMenuItem(menuItem)
             
         default:
+            
             return false
             
         }
index 0046906..eca826c 100644 (file)
@@ -15,9 +15,11 @@ private func cacheable(status: Int) -> Bool {
     case 200, 203, 206,
          301, 304,
          404, 410:
+        
         return true
         
     default:
+        
         return false
         
     }
index d968e82..1805712 100644 (file)
@@ -149,6 +149,7 @@ final class ChangeHenseiCommand: JSONCommand {
     private func position(of shipId: Int) -> (deckNumber: Int?, shipId: Int) {
         
         let store = ServerDataStore.default
+        
         return store.sync {
             
             store
index 907270f..3c08347 100644 (file)
@@ -82,9 +82,13 @@ final class CommandRegister {
         }
         
         #if ENABLE_JSON_LOG
+        
             return JSONViewCommand(apiResponse: response, command: concreteCommand(for: response))
+        
         #else
+        
             return concreteCommand(for: response)
+        
         #endif
     }
     
index 7838876..dcc180d 100644 (file)
@@ -68,6 +68,7 @@ extension Notification {
         }
         
         let inserted = userInfo[infoKey] as? Set<NSManagedObject>
+        
         return inserted?.compactMap({ $0 as? T }) ?? []
     }
 }
index ac73419..47e9916 100644 (file)
@@ -122,9 +122,12 @@ extension DamageCalculator {
                  .combinedAir,
                  .eachCombinedWater,
                  .eachCombinedAir:
+                
                 return .secondOnly
                 
-            default: return .normal
+            default:
+                
+                return .normal
                 
             }
         }
@@ -201,9 +204,11 @@ extension DamageCalculator {
         switch battleType {
             
         case .combinedAir, .combinedWater, .eachCombinedAir, .eachCombinedWater:
+            
             return true
             
         default:
+            
             return false
             
         }
@@ -490,6 +495,7 @@ extension DamageCalculator {
     private func damageControlIfPossible(ship: Ship) -> Int {
         
         let store = ServerDataStore.default
+        
         return store.sync {
             
             let damageControl = ship
@@ -507,10 +513,12 @@ extension DamageCalculator {
                     
                 case .damageControl:
                     Debug.print("Damage Control", level: .debug)
+                    
                     return Int(Double(ship.maxhp) * 0.2)
                     
                 case .goddes:
                     Debug.print("Goddes", level: .debug)
+                    
                     return ship.maxhp
                     
                 }
@@ -528,10 +536,12 @@ extension DamageCalculator {
                 
             case .damageControl:
                 Debug.print("Damage Control", level: .debug)
+                
                 return Int(Double(ship.maxhp) * 0.2)
                 
             case .goddes:
                 Debug.print("Goddes", level: .debug)
+                
                 return ship.maxhp
                 
             }
index 8e54c42..c368938 100644 (file)
@@ -31,20 +31,22 @@ final class DamageValueTransformer: ValueTransformer {
         
         switch type {
             
-        case .none:
-            return nil
+        case .none: return nil
             
         case .slightly:
+            
             return ("●",
                     [.foregroundColor: #colorLiteral(red: 1, green: 0.925, blue: 0, alpha: 1), .paragraphStyle: paragraphStyle]
             )
             
         case .modest:
+            
             return ("●",
                     [.foregroundColor: #colorLiteral(red: 1, green: 0.32, blue: 0, alpha: 1), .paragraphStyle: paragraphStyle]
             )
             
         case .badly:
+            
             return ("◼︎",
                     [.foregroundColor: #colorLiteral(red: 0.87, green: 0, blue: 0.036, alpha: 1), .paragraphStyle: paragraphStyle]
             )
index 282506e..1486174 100644 (file)
@@ -45,15 +45,19 @@ final class DamageView: NSView {
         switch innerDamageType {
             
         case .none:
+            
             return nil
             
         case .slightly:
+            
             return #colorLiteral(red: 1.000, green: 0.956, blue: 0.012, alpha: 0.5)
             
         case .modest:
+            
             return NSColor.orange.withAlphaComponent(0.5)
             
         case .badly:
+            
             return NSColor.red.withAlphaComponent(0.5)
             
         }
@@ -64,15 +68,19 @@ final class DamageView: NSView {
         switch innerDamageType {
             
         case .none:
+            
             return nil
             
         case .slightly:
+            
             return NSColor.orange.withAlphaComponent(0.5)
             
         case .modest:
+            
             return NSColor.orange.withAlphaComponent(0.9)
             
         case .badly:
+            
             return NSColor.red.withAlphaComponent(0.9)
             
         }
@@ -83,9 +91,11 @@ final class DamageView: NSView {
         switch controlSize {
             
         case .regular:
+            
             return pathForRegular
             
         case .small, .mini:
+            
             return pathForSmall
             
         }
@@ -98,9 +108,11 @@ final class DamageView: NSView {
         switch innerDamageType {
             
         case .none:
+            
             return nil
             
         case .slightly:
+            
             return Polygon()
                 .move(to: NSPoint(x: 35.0, y: height - 2.0))
                 .line(to: NSPoint(x: 0.0, y: height - 2.0))
@@ -108,6 +120,7 @@ final class DamageView: NSView {
                 .close()
             
         case .modest:
+            
             return Polygon()
                 .move(to: NSPoint(x: 50.0, y: height - 2.0))
                 .line(to: NSPoint(x: 25.0, y: height - 2.0))
@@ -116,6 +129,7 @@ final class DamageView: NSView {
                 .close()
             
         case .badly:
+            
             return Polygon()
                 .move(to: NSPoint(x: 60.0, y: height - 2.0))
                 .line(to: NSPoint(x: 53.0, y: height - 2.0))
@@ -138,9 +152,11 @@ final class DamageView: NSView {
         switch innerDamageType {
             
         case .none:
+            
             return nil
             
         case .slightly:
+            
             return Polygon()
                 .move(to: NSPoint(x: 35.0, y: height - 2.0))
                 .line(to: NSPoint(x: 0.0, y: height - 2.0))
@@ -148,6 +164,7 @@ final class DamageView: NSView {
                 .close()
             
         case .modest:
+            
             return Polygon()
                 .move(to: NSPoint(x: 50.0, y: height - 2.0))
                 .line(to: NSPoint(x: 25.0, y: height - 2.0))
@@ -156,6 +173,7 @@ final class DamageView: NSView {
                 .close()
             
         case .badly:
+            
             return Polygon()
                 .move(to: NSPoint(x: 55.0, y: height - 2.0))
                 .line(to: NSPoint(x: 48.0, y: height - 2.0))
index 092801f..4b69786 100644 (file)
@@ -63,9 +63,13 @@ final class Debug {
     class func dump<T>(_ value: T, name: String? = nil, indent: Int = 0, maxDepth: Int = Int.max, maxItems: Int = Int.max) -> T {
         
         #if DEBUG
+        
             return Swift.dump(value, name: name, indent: indent, maxDepth: maxDepth, maxItems: maxItems)
+        
         #else
+        
             return value
+        
         #endif
     }
     
index fe1a3c2..2c31732 100644 (file)
@@ -8,7 +8,7 @@
 
 import Cocoa
 
-// swiftlint:disable variable_name
+// swiftlint:disable identifier_name
 final class Deck: KCManagedObject {
     
     @NSManaged var flagship: NSNumber?
@@ -28,7 +28,7 @@ final class Deck: KCManagedObject {
     @NSManaged var ship_5: Int
     @NSManaged var ship_6: Int
 }
-// swiftlint:eable variable_name
+// swiftlint:eable identifier_name
 
 extension Deck {
     
index cf4cc6d..bacbd5b 100644 (file)
@@ -27,6 +27,7 @@ extension UserDefaults {
         guard let object = object else {
             
             self.removeObject(forKey: key)
+            
             return
         }
         
index fe6b92c..5f61bb8 100644 (file)
@@ -204,9 +204,11 @@ extension ExternalBrowserWindowController {
         switch action {
             
         case #selector(ExternalBrowserWindowController.addBookmark(_:)):
+            
             return webView.mainFrameURL != nil
             
         case #selector(ExternalBrowserWindowController.showBookmark(_:)):
+            
             if showsBookmarkList() {
                 
                 menuItem.title = LocalizedStrings.hideBookmark.string
@@ -215,15 +217,19 @@ extension ExternalBrowserWindowController {
                 
                 menuItem.title = LocalizedStrings.showBookmark.string
             }
+            
             return true
             
         case #selector(ExternalBrowserWindowController.selectBookmark(_:)):
+            
             return true
             
         case #selector(ExternalBrowserWindowController.reloadContent(_:)):
+            
             return true
             
         default:
+            
             return false
             
         }
index 4239124..6137a7d 100644 (file)
@@ -216,6 +216,7 @@ final class GameViewController: NSViewController {
         switch action {
             
         case #selector(GameViewController.reloadContent(_:)):
+            
             guard let _ = webView.mainFrame else {
                 
                 return true
@@ -241,9 +242,11 @@ final class GameViewController: NSViewController {
             return true
             
         case #selector(GameViewController.deleteCacheAndReload(_:)):
+            
             return true
             
         case #selector(GameViewController.screenShot(_:)):
+            
             return true
             
         default: return false
index fd6b32d..40d1170 100644 (file)
@@ -65,11 +65,9 @@ final class GuardShelterCommand: JSONCommand {
                 
             }
             
-        case 3:
-            return store.sync { store.deck(by: 3)?.shipId(of: damagedPos - 1) }
+        case 3: return store.sync { store.deck(by: 3)?.shipId(of: damagedPos - 1) }
             
-        default:
-            return nil
+        default: return nil
             
         }
     }
index d06a8c0..36ba893 100644 (file)
@@ -111,9 +111,11 @@ class HistoryTableViewController: NSViewController {
         switch itemTag {
             
         case .delete:
+            
             return controller.selectionIndex != -1
             
         case .addMark:
+            
             menuItem.isEnabled = false
             guard let clickedRow = tableView?.clickedRow else {
                 
index 1775f16..6326c49 100644 (file)
@@ -8,7 +8,7 @@
 
 import Foundation
 
-// swiftlint:disable variable_name
+// swiftlint:disable identifier_name
 final class KenzoDock: KCManagedObject {
     
     @NSManaged var complete_time: Int
index df8d3ef..7b4c47a 100644 (file)
@@ -8,7 +8,7 @@
 
 import Cocoa
 
-// swiftlint:disable variable_name
+// swiftlint:disable identifier_name
 final class KenzoMark: NSManagedObject {
     
     @NSManaged var bauxite: Int
index 59eafa5..1ae659b 100644 (file)
@@ -8,7 +8,7 @@
 
 import Cocoa
 
-// swiftlint:disable variable_name
+// swiftlint:disable identifier_name
 final class MasterFurniture: KCManagedObject {
     
     @NSManaged var description_: String?
index 0c526cd..b9063ef 100644 (file)
@@ -8,7 +8,7 @@
 
 import Foundation
 
-// swiftlint:disable variable_name
+// swiftlint:disable identifier_name
 final class MasterMapInfo: KCManagedObject {
     
     @NSManaged var id: Int
index 6a0c84e..b5fa7b5 100644 (file)
@@ -8,7 +8,7 @@
 
 import Foundation
 
-// swiftlint:disable variable_name
+// swiftlint:disable identifier_name
 final class MasterMission: KCManagedObject {
     
     @NSManaged var details: String?
index 1576dde..2da8c09 100644 (file)
@@ -8,7 +8,7 @@
 
 import Foundation
 
-// swiftlint:disable variable_name
+// swiftlint:disable identifier_name
 final class MasterShip: KCManagedObject {
     
     @NSManaged var afterbull: NSNumber?
index cb47589..5248e94 100644 (file)
@@ -8,7 +8,7 @@
 
 import Foundation
 
-// swiftlint:disable variable_name
+// swiftlint:disable identifier_name
 final class MasterSlotItem: KCManagedObject {
     
     @NSManaged var atap: NSNumber?
index b61fd4d..e6c740b 100644 (file)
@@ -8,7 +8,7 @@
 
 import Foundation
 
-// swiftlint:disable variable_name
+// swiftlint:disable identifier_name
 final class MasterSlotItemEquipType: KCManagedObject {
     
     @NSManaged var id: Int
index 2520e74..d70acf8 100644 (file)
@@ -8,7 +8,7 @@
 
 import Cocoa
 
-// swiftlint:disable variable_name
+// swiftlint:disable identifier_name
 final class MasterUseItem: KCManagedObject {
     
     @NSManaged var category: NSNumber?
index b6136eb..4f84210 100644 (file)
@@ -8,7 +8,7 @@
 
 import Foundation
 
-// swiftlint:disable variable_name
+// swiftlint:disable identifier_name
 final class NyukyoDock: KCManagedObject {
     
     @NSManaged var complete_time: Int
index 8fe652f..ce83056 100644 (file)
@@ -8,7 +8,7 @@
 
 import Foundation
 
-// swiftlint:disable variable_name
+// swiftlint:disable identifier_name
 final class Quest: KCManagedObject {
     
     @NSManaged var bonus_flag: Bool
@@ -25,7 +25,7 @@ final class Quest: KCManagedObject {
     @NSManaged var title: String
     @NSManaged var type: Int
 }
-// swiftlint:eable variable_name
+// swiftlint:eable identifier_name
 
 extension Quest {
     
index ff70e1a..4e34260 100644 (file)
@@ -47,6 +47,7 @@ final class ResourceHistoryManager: NSObject {
         guard let notifyDate = Calendar.current.date(from: nowComp) else {
             
             print("ResourceHistoryManager: Can not create notify date")
+            
             return
         }
         
index eb4860e..52600c9 100644 (file)
@@ -103,6 +103,7 @@ final class ScreenshotEditorViewController: BridgeViewController {
                         
                         return false
                     }
+                    
                     return $0.rect == currentTrimInfo.rect
                 }
                 .map { UserDefaults.standard[.scrennshotEditorType] = $0 }
index cdf7dc7..933dd25 100644 (file)
@@ -8,7 +8,7 @@
 
 import Cocoa
 
-// swiftlint:disable variable_name
+// swiftlint:disable identifier_name
 final class Ship: KCManagedObject {
     
     @NSManaged dynamic var bull: Int
@@ -64,7 +64,7 @@ final class Ship: KCManagedObject {
     @NSManaged dynamic var master_ship: MasterShip
     @NSManaged dynamic var extraItem: SlotItem?
 }
-// swiftlint:eable variable_name
+// swiftlint:eable identifier_name
 
 private let shortSTypeNames: [String] = {
     
index 79276c6..64ee02a 100644 (file)
@@ -88,13 +88,16 @@ final class ShipMapper: JSONMapper {
         switch apiResponse.api.endpoint {
             
         case .ship3, .getShip, .shipDeck, .powerup, .slotDeprive:
+            
             return false
             
         case .ship2:
             // 特殊任務のクリア時にship2がapi_shipid付きでリクエストされ、その艦娘のデータしかない時があるため
+            
             return !apiResponse.parameter["api_shipid"].valid
             
         default:
+            
             return true
             
         }
@@ -253,7 +256,9 @@ final class ShipMapper: JSONMapper {
     private func setExtraSlot(_ exSlotItem: Int, to ship: Ship) {
         
         guard exSlotItem != -1, exSlotItem != 0 else {
+            
             ship.extraItem = nil
+            
             return
         }
         guard let found = slotItems.binarySearch(comparator: { $0.id ==? exSlotItem }),
index a8c85aa..a5f0a74 100644 (file)
@@ -189,9 +189,11 @@ final class ShipViewController: MainTabVIewItemViewController {
             return cell?.tag(forSegment: segmented.selectedSegment) ?? -1
             
         case let control as NSControl:
+            
             return control.tag
             
         default:
+            
             return -1
             
         }
index de4b6df..a5f28e3 100644 (file)
@@ -8,7 +8,7 @@
 
 import Foundation
 
-// swiftlint:disable variable_name
+// swiftlint:disable identifier_name
 final class SlotItem: KCManagedObject {
     
     @NSManaged var alv: Int
@@ -20,7 +20,7 @@ final class SlotItem: KCManagedObject {
     @NSManaged var master_slotItem: MasterSlotItem
     @NSManaged var extraEquippedShip: Ship?
 }
-// swiftlint:eable variable_name
+// swiftlint:eable identifier_name
 
 extension SlotItem {
     
index 32abb33..098aff2 100644 (file)
@@ -47,13 +47,16 @@ final class SlotItemWindowController: NSWindowController {
         switch UserDefaults.standard[.showEquipmentType] {
             
         case .all:
+            
             return nil
             
         case .nonEquiped:
+            
             return NSPredicate.isNil(#keyPath(SlotItem.equippedShip.lv))
                 .and(.isNil(#keyPath(SlotItem.extraEquippedShip.lv)))
             
         case .equiped:
+            
             return NSPredicate.empty
                 .and(.isNotNil(#keyPath(SlotItem.equippedShip.lv)))
                 .or(.isNotNil(#keyPath(SlotItem.extraEquippedShip.lv)))
@@ -110,6 +113,7 @@ extension SlotItemWindowController {
             Bundle.main.loadNibNamed(NSNib.Name("SlotItemWindowTouchBar"),
                                      owner: self,
                                      topLevelObjects: &topLevel)
+            
             return myTouchBar
         }
         set {}
index 12ebaa4..d46be7e 100644 (file)
@@ -80,6 +80,7 @@ final class StoreCreateSlotItemHistoryCommand: JSONCommand {
         }
         
         let store = ServerDataStore.default
+        
         return store.sync { store.masterSlotItem(by: slotItemId)?.name ?? "" }
     }
 }
index 180c98c..3ae6ced 100644 (file)
@@ -27,8 +27,7 @@ extension StrengthenListCellType {
         
         let v = tableView.makeView(withIdentifier: cellIdentifier, owner: nil)
         
-        // swiftlint:disable:next force_cast
-        return v as! NSTableCellView
+        return v as! NSTableCellView    // swiftlint:disable:this force_cast
     }
 }
 
index de3ec79..490c8bd 100644 (file)
@@ -62,6 +62,7 @@ final class StrengthenListItemCellView: NSTableCellView {
     }
     
     @objc var targetEquipment: String? {
+        
         return item?.targetEquipment
     }
     
index 93f2900..ea11c9f 100644 (file)
@@ -217,6 +217,7 @@ extension StrengthenListViewController: NSTableViewDelegate {
     func tableView(_ tableView: NSTableView, viewFor tableColumn: NSTableColumn?, row: Int) -> NSView? {
         
         let item = filteredItems[row]
+        
         return item.cellType.makeCellWithItem(item: item, tableView: tableView, owner: nil)
     }
     
index b92ee56..96afb75 100644 (file)
@@ -168,6 +168,7 @@ final class TSVSupport {
         guard let array = try? store.objects(of: entity, sortDescriptors: sortDesc) else {
             
             print("Can not get \(entity)")
+            
             return []
         }
         
index d6a2ede..ac49934 100644 (file)
@@ -139,6 +139,7 @@ final class TiledImageView: NSView {
             
             imageCell.image = nil
             needsDisplay = true
+            
             return
         }
         
index b9e56bb..15a0ec5 100644 (file)
@@ -17,6 +17,7 @@ final class WindowManager {
     
         let vc = JSONViewWindowController()
         vc.showWindow(nil)
+        
         return vc
     }()
     #else
@@ -28,6 +29,7 @@ final class WindowManager {
     
         let vc = UITestWindowController()
         vc.showWindow(nil)
+        
         return vc
     }()
     #else
@@ -330,50 +332,64 @@ extension WindowManager {
         switch action {
             
         case #selector(WindowManager.showHideHistory(_:)):
+            
             setTitle(to: menuItem,
                      frontWindow: historyWindowController.window,
                      show: LocalizedStrings.showHistory.string,
                      hide: LocalizedStrings.hideHistory.string)
+            
             return true
             
         case #selector(WindowManager.showHideSlotItemWindow(_:)):
+            
             setTitle(to: menuItem,
                      frontWindow: slotItemWindowController.window,
                      show: LocalizedStrings.showSlotItem.string,
                      hide: LocalizedStrings.hideSlotItem.string)
+            
             return true
             
         case #selector(WindowManager.showHideUpgradableShipWindow(_:)):
+            
             setTitle(to: menuItem,
                      frontWindow: upgradableShipWindowController.window,
                      show: LocalizedStrings.showUpgradableShips.string,
                      hide: LocalizedStrings.hideUpgradableShips.string)
+            
             return true
             
         case #selector(WindowManager.showHideScreenshotListWindow(_:)):
+            
             setTitle(to: menuItem,
                      frontWindow: screenshotListWindowController.window,
                      show: LocalizedStrings.showScreenshotList.string,
                      hide: LocalizedStrings.hideScreenshotList.string)
+            
             return true
             
         case #selector(WindowManager.showHideAirBaseInfoWindow(_:)):
+            
             setTitle(to: menuItem,
                      frontWindow: airBaseWindowController.window,
                      show: LocalizedStrings.showAirbaseInfo.string,
                      hide: LocalizedStrings.hideAirbaseInfo.string)
+            
             return true
             
         case #selector(WindowManager.showHidePreferencePanle(_:)):
+            
             return true
             
         case #selector(WindowManager.openNewBrowser(_:)):
+            
             return true
             
         case #selector(WindowManager.selectBookmark(_:)):
+            
             return true
             
         case #selector(WindowManager.showWindowAduster(_:)):
+            
             return true
             
         case #selector(WindowManager.showShipWindow(_:)),
@@ -389,6 +405,7 @@ extension WindowManager {
             return canSaveLog
             
         default:
+            
             return false
         }
     }
index ce3fed1..f8fe87d 100644 (file)
@@ -94,6 +94,7 @@ class GuardEscapeTest: XCTestCase {
             guard let battle = store.createBattle() else {
                 
                 XCTFail("Can not create battle")
+                
                 return
             }
             
@@ -182,6 +183,7 @@ class GuardEscapeTest: XCTestCase {
             guard let battle = store.createBattle() else {
                 
                 XCTFail("Can not create battle")
+                
                 return
             }
             
index c02c6b4..8d1bccf 100644 (file)
@@ -264,12 +264,12 @@ class NormalBattleTest: XCTestCase {
             
             store.ship(by: 4).flatMap {
                 $0.nowhp = $0.maxhp
-                $0.slot_ex = 63765  // 女神
+                $0.slot_ex = 63_765  // 女神
             }
             store.ship(by: 5).flatMap {
                 $0.nowhp = $0.maxhp
                 // ダメコン
-                $0.equippedItem = store.slotItem(by: 72418).map { NSOrderedSet(array: [$0]) } ?? []
+                $0.equippedItem = store.slotItem(by: 8_175).map { NSOrderedSet(array: [$0]) } ?? []
             }
         }