RegexRule

abstract class RegexRule(ruleName: String, pattern: String, message: String, val defaultSeverity: Severity = Severity.Warning, val defaultEnable: Boolean = true, val targetCapability: DialectCapability? = null, hashLineComments: Boolean = false) : Rule

Base implementation for rules that report regular expression matches in masked SQL source text.

Comments and quoted text are replaced with spaces before matching, so diagnostic ranges still point at the original source offsets.

Constructors

Link copied to clipboard
constructor(ruleName: String, pattern: String, message: String, defaultSeverity: Severity = Severity.Warning, defaultEnable: Boolean = true, targetCapability: DialectCapability? = null, hashLineComments: Boolean = false)

Properties

Link copied to clipboard
open override val defaultEnable: Boolean

Whether this rule can run by default before user configuration and auto applicability are resolved.

Link copied to clipboard

Default enablement derived from Rule.defaultEnable.

Link copied to clipboard
open override val defaultSeverity: Severity

Default severity used when user configuration does not override it.

Link copied to clipboard
open override val id: RuleId

Rule-local ID, such as no-select-star.

Link copied to clipboard

Dialect capability required when this rule is resolved with Auto.

Functions

Link copied to clipboard
open fun isApplicable(context: RuleContext): Boolean

Returns whether this rule applies to the current context when enablement is Auto.

Link copied to clipboard
open override fun run(context: RuleContext, reporter: DiagnosticReporter)

Runs this rule against the current context.