Region
public struct Region : Equatable, Sendable
A contiguous region of Swift source code.
-
The location describing the start of the region. All locations that are less than this value (earlier in the source file) are not contained in this region.
Declaration
Swift
public let start: Location -
The location describing the end of the region. All locations that are greater than this value (later in the source file) are not contained in this region.
Declaration
Swift
public let end: Location -
All SwiftLint rule identifiers that are disabled in this region.
Declaration
Swift
public let disabledRuleIdentifiers: Set<RuleIdentifier> -
Creates a Region by setting explicit values for all its properties.
Declaration
Swift
public init(start: Location, end: Location, disabledRuleIdentifiers: Set<RuleIdentifier>)Parameters
startThe region’s starting location.
endThe region’s ending location.
disabledRuleIdentifiersAll SwiftLint rule identifiers that are disabled in this region.
-
Whether the specific location is contained in this region.
Declaration
Swift
public func contains(_ location: Location) -> BoolParameters
locationThe location to check for containment.
Return Value
True if the specific location is contained in this region.
-
Whether the specified rule is enabled in this region.
Declaration
Swift
public func isRuleEnabled(_ rule: some Rule) -> BoolParameters
ruleThe rule whose status should be determined.
Return Value
True if the specified rule is enabled in this region.
-
Whether the specified rule is disabled in this region.
Note
For CustomRules, this will only return true if the
custom_rulesidentifier is used with theswiftlintdisable command, but this method is never called for CustomRules.Declaration
Swift
public func isRuleDisabled(_ rule: some Rule) -> BoolParameters
ruleThe rule whose status should be determined.
Return Value
True if the specified rule is disabled in this region.
-
Whether the given rules are disabled in this region.
Declaration
Swift
public func areRulesDisabled(ruleIDs: [String]) -> BoolParameters
ruleIDsA list of rule IDs. Typically all identifiers of a single rule.
Return Value
True if the specified rules are disabled in this region.
-
Returns the deprecated rule aliases that are disabling the specified rule in this region. Returns the empty set if the rule isn’t disabled in this region.
Declaration
Swift
public func deprecatedAliasesDisabling(rule: some Rule) -> Set<String>Parameters
ruleThe rule to check.
Return Value
Deprecated rule aliases.
View on GitHub
Install in Dash