Rule

interface Rule

Lint or formatting rule contributed by a rule set.

Rule implementations are loaded through a RuleSetProvider and run after SQLDelight accepts the source file.

Properties

Link copied to clipboard

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

Default severity used when user configuration does not override it.

Link copied to clipboard

Deprecation metadata when this rule is kept only for compatibility.

Link copied to clipboard
abstract val id: RuleId

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

Link copied to clipboard

Dialect ID 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
fun Rule.reportSqlStatementMatches(context: RuleContext, reporter: DiagnosticReporter, message: String, hashLineComments: Boolean = false, findMatch: (statement: List<SqlToken>) -> SqlTokenMatch?)

Tokenizes the current file and reports matches found per statement.

Link copied to clipboard
fun Rule.reportSqlTokenMatch(context: RuleContext, reporter: DiagnosticReporter, message: String, match: SqlTokenMatch)

Reports a diagnostic for match using this rule's default severity.

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

Runs this rule against the current context.