mirror of
https://github.com/realm/SwiftLint.git
synced 2026-05-07 20:12:49 +00:00
77050e8c40
If SwiftLint is built from this state using the Swift SDK, we'll get a large self-contained Linux executable that runs without loading SourceKit. It can do that by disabling any rule that requires SourceKit. With `SWIFTLINT_DISABLE_SOURCEKIT` set on a normally (dynamically linked) binary, the behavior is the same. That's different from the previously reported more serious warnings.
12 lines
642 B
Swift
12 lines
642 B
Swift
/// This allows SourceKit request handling to determine certain properties without
|
|
/// modifying function signatures throughout the codebase.
|
|
public enum CurrentRule {
|
|
/// A task-local value that holds the identifier of the currently executing rule, e.g., to check whether the rule
|
|
/// is allowed to make SourceKit requests.
|
|
@TaskLocal public static var identifier: String?
|
|
|
|
/// Allows specific SourceKit requests to be made outside of rule execution context.
|
|
/// This should only be used for essential operations like getting the Swift version.
|
|
@TaskLocal public static var allowSourceKitRequestWithoutRule = false
|
|
}
|