From 15c25abc47b607e6b22c29a643b349dfb4b33a9a Mon Sep 17 00:00:00 2001 From: JP Simard Date: Wed, 23 Sep 2020 08:34:46 -0700 Subject: [PATCH] Update SourceKitten to 0.30.1 (#3367) --- Cartfile | 2 +- Cartfile.resolved | 2 +- Carthage/Checkouts/SourceKitten | 2 +- Package.resolved | 4 ++-- Package.swift | 2 +- .../Rules/Lint/UnusedDeclarationRule.swift | 9 ++------- SwiftLintFramework.podspec | 2 +- 7 files changed, 9 insertions(+), 14 deletions(-) diff --git a/Cartfile b/Cartfile index 290dddf6aa..16b2a0adc3 100644 --- a/Cartfile +++ b/Cartfile @@ -1,2 +1,2 @@ -github "jpsim/SourceKitten" ~> 0.30.0 +github "jpsim/SourceKitten" ~> 0.30.1 github "scottrhoyt/SwiftyTextTable" ~> 0.9.0 diff --git a/Cartfile.resolved b/Cartfile.resolved index 62f089f070..bbc9545e6f 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1,6 +1,6 @@ github "Carthage/Commandant" "0.17.0" github "drmohundro/SWXMLHash" "5.0.1" -github "jpsim/SourceKitten" "0.30.0" +github "jpsim/SourceKitten" "0.30.1" github "jpsim/Yams" "4.0.0" github "jspahrsummers/xcconfigs" "0.12" github "scottrhoyt/SwiftyTextTable" "0.9.0" diff --git a/Carthage/Checkouts/SourceKitten b/Carthage/Checkouts/SourceKitten index b7a7df0d25..c0f960f72f 160000 --- a/Carthage/Checkouts/SourceKitten +++ b/Carthage/Checkouts/SourceKitten @@ -1 +1 @@ -Subproject commit b7a7df0d25981998bb9f4770ff8faf7a28a6e649 +Subproject commit c0f960f72fa1e6151695074ffa696e4da6c45ce8 diff --git a/Package.resolved b/Package.resolved index 97e74fc78b..c5ff5596ac 100644 --- a/Package.resolved +++ b/Package.resolved @@ -33,8 +33,8 @@ "repositoryURL": "https://github.com/jpsim/SourceKitten.git", "state": { "branch": null, - "revision": "b7a7df0d25981998bb9f4770ff8faf7a28a6e649", - "version": "0.30.0" + "revision": "c0f960f72fa1e6151695074ffa696e4da6c45ce8", + "version": "0.30.1" } }, { diff --git a/Package.swift b/Package.swift index 425a072569..009faeb6d0 100644 --- a/Package.swift +++ b/Package.swift @@ -15,7 +15,7 @@ let package = Package( ], dependencies: [ .package(url: "https://github.com/Carthage/Commandant.git", .upToNextMinor(from: "0.17.0")), - .package(url: "https://github.com/jpsim/SourceKitten.git", .upToNextMinor(from: "0.30.0")), + .package(url: "https://github.com/jpsim/SourceKitten.git", .upToNextMinor(from: "0.30.1")), .package(url: "https://github.com/jpsim/Yams.git", from: "4.0.0"), .package(url: "https://github.com/scottrhoyt/SwiftyTextTable.git", from: "0.9.0"), ] + (addCryptoSwift ? [.package(url: "https://github.com/krzyzanowskim/CryptoSwift.git", .upToNextMinor(from: "1.0.0"))] : []), diff --git a/Source/SwiftLintFramework/Rules/Lint/UnusedDeclarationRule.swift b/Source/SwiftLintFramework/Rules/Lint/UnusedDeclarationRule.swift index 80559a1427..6eaaffca1a 100644 --- a/Source/SwiftLintFramework/Rules/Lint/UnusedDeclarationRule.swift +++ b/Source/SwiftLintFramework/Rules/Lint/UnusedDeclarationRule.swift @@ -136,7 +136,7 @@ private extension SwiftLintFile { } if indexEntity.shouldSkipIndexEntityToWorkAroundSR11985() || - indexEntity.isIndexEntityUsedForSwiftUI() || + indexEntity.isIndexEntitySwiftUIProvider() || indexEntity.enclosedSwiftAttributes.contains(where: declarationAttributesToSkip.contains) || indexEntity.value["key.is_implicit"] as? Bool == true || indexEntity.value["key.is_test_candidate"] as? Bool == true { @@ -221,12 +221,6 @@ private extension SourceKittenDictionary { return nil } - func isIndexEntityUsedForSwiftUI() -> Bool { - return isIndexEntitySwiftUIProvider() || - // Move to `declarationAttributesToSkip` when we can use https://github.com/jpsim/SourceKitten/pull/670 - swiftAttributes.contains(where: { $0.attribute == "source.decl.attribute.main" }) - } - func isIndexEntitySwiftUIProvider() -> Bool { return (value["key.related"] as? [[String: SourceKitRepresentable]])? .map(SourceKittenDictionary.init) @@ -276,6 +270,7 @@ private let declarationAttributesToSkip: Set = [ .ibaction, .ibinspectable, .iboutlet, + .main, .nsApplicationMain, .override, .uiApplicationMain diff --git a/SwiftLintFramework.podspec b/SwiftLintFramework.podspec index cdc630b8b5..39d839f24e 100644 --- a/SwiftLintFramework.podspec +++ b/SwiftLintFramework.podspec @@ -10,6 +10,6 @@ Pod::Spec.new do |s| s.source_files = 'Source/SwiftLintFramework/**/*.swift' s.swift_versions = ['5.1', '5.2'] s.pod_target_xcconfig = { 'APPLICATION_EXTENSION_API_ONLY' => 'YES' } - s.dependency 'SourceKittenFramework', '~> 0.30.0' + s.dependency 'SourceKittenFramework', '~> 0.30.1' s.dependency 'Yams', '~> 4.0' end