mirror of
https://github.com/realm/SwiftLint.git
synced 2026-06-06 20:18:40 +00:00
14 lines
449 B
Swift
14 lines
449 B
Swift
import Foundation
|
|
import SourceKittenFramework
|
|
|
|
extension Request {
|
|
static let disableSourceKit = ProcessInfo.processInfo.environment["SWIFTLINT_DISABLE_SOURCEKIT"] != nil
|
|
|
|
func sendIfNotDisabled() throws -> [String: SourceKitRepresentable] {
|
|
guard !Self.disableSourceKit else {
|
|
throw Self.Error.connectionInterrupted("SourceKit is disabled by `SWIFTLINT_DISABLE_SOURCEKIT`.")
|
|
}
|
|
return try send()
|
|
}
|
|
}
|