import type { Diagnostic, ParsedStatement, SuppressedDiagnostic } from './types'; /** * Inline suppression directives, written as SQL comments, that silence findings * the author has judged safe. Modelled on `eslint-disable` and tuned to the way * migrations read top to bottom. * * Syntax (in a `--` line comment or a block comment): * * -- psm-disable-next-line [rules] [-- reason] the statement below * -- psm-disable-line [rules] [-- reason] the statement on this line * -- psm-disable-file [rules] [-- reason] the whole file * -- psm-disable [rules] from here… * -- psm-enable [rules] …until here * * `rules` is an optional space/comma-separated list of rule names; omit it to * suppress every rule. `reason` (after ` -- ` or `:`) is free text. `psm-ignore` * and `psm-ignore-file` are accepted as aliases for the next-line and file forms. */ export type SuppressionKind = 'next-line' | 'line' | 'file' | 'block-disable' | 'block-enable'; export interface Suppression { kind: SuppressionKind; /** Rule names this directive targets. Empty means "all rules". */ rules: string[]; /** 1-based line the directive comment begins on. */ line: number; /** Optional human explanation of why the finding is acceptable. */ reason?: string; } export interface SuppressionResult { /** Diagnostics that survived (were not suppressed). */ kept: Diagnostic[]; /** Diagnostics that an inline directive silenced. */ suppressed: SuppressedDiagnostic[]; } /** Read all suppression directives from a migration's SQL. */ export declare function parseSuppressions(sql: string): Suppression[]; /** * Partition diagnostics into those a directive silences and those that remain. * * Each directive covers a line range (a statement, the file, or a block), and a * diagnostic is suppressed when it falls inside a covering range whose rule * filter matches. Directives are resolved against statement boundaries so a * `disable-next-line` above a multi-line statement covers the whole statement, * not just its first line. */ export declare function applySuppressions(diagnostics: Diagnostic[], suppressions: Suppression[], statements: ParsedStatement[], totalLines: number): SuppressionResult; //# sourceMappingURL=suppressions.d.ts.map