Files
Danny Mösch 77050e8c40 Enable a fully statically linked Linux executable (#6211)
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.
2025-08-30 10:02:38 -04:00

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
}