RegexConfiguration
public struct RegexConfiguration<Parent: Rule>: SeverityBasedRuleConfiguration, Hashable,
CacheDescriptionProvider, InlinableOptionType
A rule configuration used for defining custom rules in yaml.
-
The identifier for this custom rule.
Declaration
Swift
public let identifier: String
-
The name for this custom rule.
Declaration
Swift
public var name: String?
-
The message to be presented when producing violations.
Declaration
Swift
public var message: String
-
Regular expressions to include when matching the file path.
Declaration
Swift
public var included: [NSRegularExpression]
-
Regular expressions to exclude when matching the file path.
Declaration
Swift
public var excluded: [NSRegularExpression]
-
The syntax kinds to exclude from matches. If the regex matched syntax kinds from this list, it would be ignored and not count as a rule violation.
Declaration
Swift
public var excludedMatchKinds: Set<SyntaxKind>
-
Declaration
Swift
@ConfigurationElement public var severityConfiguration: SeverityConfiguration<Parent> { get set }
-
The index of the regex capture group to match.
Declaration
Swift
public var captureGroup: Int
-
Declaration
Swift
public var cacheDescription: String { get }
-
The
RuleDescription
for the custom rule defined here.Declaration
Swift
public var description: RuleDescription { get }
-
Create a
RegexConfiguration
with the specified identifier, with other properties to be set later.Declaration
Swift
public init(identifier: String)
Parameters
identifier
The rule identifier to use.
-
Declaration
Swift
public mutating func apply(configuration: Any) throws
-
Declaration
Swift
public func hash(into hasher: inout Hasher)