RuleRegistry
+public final class RuleRegistry
+
+ Container to register and look up SwiftLint rules.
+ +-
+
-
+ ++
+ + + shared +++ +++ + +++Shared rule registry instance.
+ +++Declaration
+++Swift
+
+ +public static let shared: RuleRegistry+ Show on GitHub ++
+ -
+ ++
+ + + list +++ +++ + +++Rule list associated with this registry. Lazily created, and +immutable once looked up.
+++ +Note
+ Adding registering more rules after this was first + accessed will not work. + +++Declaration
+++Swift
+
+ +public private(set) lazy var list: RuleList { get set }+ Show on GitHub ++
+ -
+ ++
+ + + register(rules:+) ++ +++ + +++Register rules.
+ +++Declaration
+++Swift
+
+ +public func register(rules: [Rule.Type])++Parameters
++ +
++ + ++ ++ rules +++ +++The rules to register.
++ Show on GitHub ++
+ -
+ ++
+ + + rule(forID:+) ++ +++ + +++Look up a rule for a given ID.
+ +++Declaration
+++Swift
+
+ +public func rule(forID id: String) -> Rule.Type?++Parameters
++ +
++ + ++ ++ id +++ +++The ID for the rule to look up.
+++Return Value
+The rule matching the specified ID, if one was found.
++ Show on GitHub ++
+ -
+ ++
+ + + registerAllRulesOnce() +++ +++ + +++Register all rules. Should only be called once before any SwiftLint code is executed.
+ +++Declaration
+++Swift
+
+ +public static func registerAllRulesOnce()+ Show on GitHub ++
+
+ View on GitHub
+
+ Install in Dash
+
+ RuleRegistry Class Reference
+