33#endif
44import Dispatch
55import Foundation
6+ import SourceKittenFramework
67
78// swiftlint:disable file_length
89
@@ -53,6 +54,7 @@ package struct LintOrAnalyzeOptions {
5354 let onlyRule : [ String ]
5455 let autocorrect : Bool
5556 let format : Bool
57+ let disableSourceKit : Bool
5658 let compilerLogPath : String ?
5759 let compileCommands : String ?
5860 let checkForUpdates : Bool
@@ -81,6 +83,7 @@ package struct LintOrAnalyzeOptions {
8183 onlyRule: [ String ] ,
8284 autocorrect: Bool ,
8385 format: Bool ,
86+ disableSourceKit: Bool ,
8487 compilerLogPath: String ? ,
8588 compileCommands: String ? ,
8689 checkForUpdates: Bool ) {
@@ -108,6 +111,7 @@ package struct LintOrAnalyzeOptions {
108111 self . onlyRule = onlyRule
109112 self . autocorrect = autocorrect
110113 self . format = format
114+ self . disableSourceKit = disableSourceKit
111115 self . compilerLogPath = compilerLogPath
112116 self . compileCommands = compileCommands
113117 self . checkForUpdates = checkForUpdates
@@ -124,6 +128,7 @@ package struct LintOrAnalyzeOptions {
124128
125129package struct LintOrAnalyzeCommand {
126130 package static func run( _ options: LintOrAnalyzeOptions ) async throws {
131+ Request . disableSourceKitOverride = options. mode == . lint && options. disableSourceKit
127132 if let workingDirectory = options. workingDirectory {
128133 if !FileManager. default. changeCurrentDirectoryPath ( workingDirectory) {
129134 throw SwiftLintError . usageError (
0 commit comments