Skip to content

Feature: Baseline file support for gradual adoption #2139

@kojiromike

Description

@kojiromike

When introducing sqruff to an existing codebase, there are often many pre-existing lint errors. Requiring all errors to be fixed before CI can pass creates a high barrier to adoption.

Prior art

Several popular linters have implemented baseline functionality:

  • PHPStan (PHP) - phpstan analyse --generate-baseline creates phpstan-baseline.neon
  • Psalm (PHP) - psalm --set-baseline=psalm-baseline.xml creates XML baseline
  • RuboCop (Ruby) - rubocop --auto-gen-config creates .rubocop_todo.yml
  • Ruff (Python, also Rust-based) - supports --baseline flag
  • ESLint (JavaScript) - feature request #13437; third-party solutions like eslint-baseline exist
  • SARB - generic Static Analysis Results Baseliner that works with multiple tools

Notably, SQLFluff (the Python linter sqruff is based on) does not have native baseline support, relying instead on -- noqa comments or downgrading rules to warnings. Native baseline support would be a differentiating feature for sqruff.

Since sqruff and Ruff are both Rust-based linters, Ruff's approach may (or may not) translate well to sqruff.

Benefits

  • Lower barrier to adoption for existing projects
  • Enables incremental improvement
  • Prevents regressions while allowing legacy issues to be addressed over time

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions