diff --git a/.swiftlint.yml b/.swiftlint.yml index c65648ed6..a8644ec2c 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -14,3 +14,5 @@ disabled_rules: excluded: - Modules/Secrets/Sources/Secrets/SecretKey.swift - Modules/Account/Tests/AccountTests/Feedly/ + - Widget/Resources/Localized.swift + diff --git a/NetNewsWire.xcodeproj/project.pbxproj b/NetNewsWire.xcodeproj/project.pbxproj index 078c4c9a3..c350e7306 100644 --- a/NetNewsWire.xcodeproj/project.pbxproj +++ b/NetNewsWire.xcodeproj/project.pbxproj @@ -370,7 +370,7 @@ isa = PBXFileSystemSynchronizedBuildFileExceptionSet; membershipExceptions = ( "NetNewsWire-iOSTests/Info.plist", - "NetNewsWire-iOSTests/NetNewsWire_iOSTests.swift", + "NetNewsWire-iOSTests/NetNewsWire-iOSTests.swift", NetNewsWireTests/Info.plist, ); target = 849C64701ED37A5D003D8FC0 /* NetNewsWireTests */; @@ -378,7 +378,7 @@ 84C1EB962CDFE31700C7456A /* PBXFileSystemSynchronizedBuildFileExceptionSet */ = { isa = PBXFileSystemSynchronizedBuildFileExceptionSet; membershipExceptions = ( - "NetNewsWire-iOSTests/NetNewsWire_iOSTests.swift", + "NetNewsWire-iOSTests/NetNewsWire-iOSTests.swift", ); target = 518B2ED12351B3DD00400001 /* NetNewsWire-iOSTests */; }; diff --git a/Shared/Constants.swift b/Shared/Constants.swift index 392e40b7a..ea17e5d16 100644 --- a/Shared/Constants.swift +++ b/Shared/Constants.swift @@ -10,5 +10,6 @@ import Foundation struct Constants { + // swiftlint:disable:next line_length static let prototypeText = "You are about to being reading Italo Calvino’s new novel, *If on a winter’s night a traveler*. Relax. Concentrate. Dispel every other thought. Let the world around you fade. Best to close the door; the TV is always on in the next room. Tell the others right away, “No, I don’t want to watch TV!” Raise your voice—they won’t hear you otherwise—“I’m reading! I don’t want to be disturbed!” Maybe they haven’t heard you, with all that racket; speak louder, yell: “I’m beginning to read Italo Calvino’s new novel!” Or if you prefer, don’t say anything; just hope they’ll leave you alone. Find the most comfortable position: seated, stretched out, curled up, or lying flat. Flat on your back, on your side, on your stomach. In an easy chair, on the sofa, in the rocker, the deck chair, on the hassock. In the hammock, if you have a hammock. On top of your bed, of course, or in the bed. You can even stand on your hands, head down, in the yoga position. With the book upside down, naturally." } diff --git a/Shared/ShareExtension/ExtensionContainersFile.swift b/Shared/ShareExtension/ExtensionContainersFile.swift index 74438009a..ccb9e6220 100644 --- a/Shared/ShareExtension/ExtensionContainersFile.swift +++ b/Shared/ShareExtension/ExtensionContainersFile.swift @@ -17,6 +17,7 @@ final class ExtensionContainersFile { private static var log = OSLog(subsystem: Bundle.main.bundleIdentifier!, category: "extensionContainersFile") private static var filePath: String = { + // swiftlint:disable:next force_cast let appGroup = Bundle.main.object(forInfoDictionaryKey: "AppGroup") as! String let containerURL = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: appGroup) return containerURL!.appendingPathComponent("extension_containers.plist").path diff --git a/Shared/ShareExtension/ExtensionFeedAddRequestFile.swift b/Shared/ShareExtension/ExtensionFeedAddRequestFile.swift index b9529a7c0..ed0e7a506 100644 --- a/Shared/ShareExtension/ExtensionFeedAddRequestFile.swift +++ b/Shared/ShareExtension/ExtensionFeedAddRequestFile.swift @@ -15,6 +15,7 @@ final class ExtensionFeedAddRequestFile: NSObject, NSFilePresenter { private static var log = OSLog(subsystem: Bundle.main.bundleIdentifier!, category: "extensionFeedAddRequestFile") private static var filePath: String = { + // swiftlint:disable:next force_cast let appGroup = Bundle.main.object(forInfoDictionaryKey: "AppGroup") as! String let containerURL = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: appGroup) return containerURL!.appendingPathComponent("extension_feed_add_request.plist").path diff --git a/Shared/Tree/FeedTreeControllerDelegate.swift b/Shared/Tree/FeedTreeControllerDelegate.swift index 9528c512f..ed8ce901e 100644 --- a/Shared/Tree/FeedTreeControllerDelegate.swift +++ b/Shared/Tree/FeedTreeControllerDelegate.swift @@ -143,11 +143,7 @@ private extension FeedTreeControllerDelegate { } func nodeInArrayRepresentingObject(_ nodes: [Node], _ representedObject: AnyObject) -> Node? { - for oneNode in nodes { - if oneNode.representedObject === representedObject { - return oneNode - } - } - return nil + + nodes.first { $0.representedObject === representedObject } } } diff --git a/Tests/NetNewsWire-iOSTests/NetNewsWire_iOSTests.swift b/Tests/NetNewsWire-iOSTests/NetNewsWire-iOSTests.swift similarity index 88% rename from Tests/NetNewsWire-iOSTests/NetNewsWire_iOSTests.swift rename to Tests/NetNewsWire-iOSTests/NetNewsWire-iOSTests.swift index 6be658515..9a81906e1 100644 --- a/Tests/NetNewsWire-iOSTests/NetNewsWire_iOSTests.swift +++ b/Tests/NetNewsWire-iOSTests/NetNewsWire-iOSTests.swift @@ -1,5 +1,5 @@ // -// NetNewsWire_iOSTests.swift +// NetNewsWire-iOSTests.swift // NetNewsWire-iOSTests // // Created by Brent Simmons on 2/5/18. @@ -8,7 +8,7 @@ import XCTest -class NetNewsWire_iOSTests: XCTestCase { +class NetNewsWire-iOSTests: XCTestCase { func testExample() { // This is an example of a functional test case. diff --git a/Tests/NetNewsWireTests/ScriptingTests/NSAppleEventDescriptor+UserRecordFields.swift b/Tests/NetNewsWireTests/ScriptingTests/NSAppleEventDescriptor+UserRecordFields.swift index 8b4a63e60..dea9e80b7 100644 --- a/Tests/NetNewsWireTests/ScriptingTests/NSAppleEventDescriptor+UserRecordFields.swift +++ b/Tests/NetNewsWireTests/ScriptingTests/NSAppleEventDescriptor+UserRecordFields.swift @@ -34,7 +34,7 @@ extension NSAppleEventDescriptor { var usrfDictionary: [String: NSAppleEventDescriptor] = [:] var processedItems = 0 while processedItems < listCount { - processedItems = processedItems + 2 + processedItems += 2 guard let nthlabel = usrfList.atIndex(processedItems-1) else { print("usrfDictionary() couldn't get item \(processedItems+1) in usrf list") continue