github sqlfluff/sqlfluff 2.0.0
[2.0.0] - 2023-03-14

latest releases: 4.2.2, 4.2.1, 4.2.0...
3 years ago

Highlights

Upgrading to 2.0 brings several important breaking changes:

  • All bundled rules have been recoded, both from generic L00X formats into groups within similar codes (e.g. an aliasing group with codes of the format AL0X), but also given names to allow much clearer referencing (e.g. aliasing.column).
  • Configuring rules now uses the rule name rather than the rule code to specify the section. Any unrecognised references in config files (whether they are references which do match existing rules by code or alias, or whether the match no rules at all) will raise warnings at runtime.
  • A complete re-write of layout and whitespace handling rules (see layout), and with that a change in how layout is configured (see configuring layout) and the combination of some rules that were previously separate. One example of this is that the legacy rules L001, L005, L006, L008, L023, L024, L039, L048 & L071 have been combined simply into LT01.
  • Dropping support for dbt versions before 1.1.

To help users upgrade to 2.0, we've put together a recommended process as part of our release notes.

Beyond the breaking changes, this release brings a load of additional changes:

  • Introduces the the sqlfluff format CLI command (a la sqlfmt or black) to auto-format sql files using a known set of fairly safe rules.
  • Databricks as a distinct new dialect (rather than as previously an alias for sparksql).
  • Performance improvements in our parsing engine.
  • Dialect improvements to almost all of them.

As a new major release, especially with significant rewrites of large portions of the codebase, we recommend using compatible release specifiers in your dependencies (i.e. sqlfluff~=2.0.0) so that you can automatically take advantage of any bugfix releases in the coming weeks. The alpha releases of 2.0.0 have been tested on a range of large projects, but we know that the range of use cases "in the wild" is very diverse. If you do experience issues, please post them on GitHub in the usual manner.

Finally thanks to everyone who has worked on this release, especially @konnectr, @ValentinCrr, @FabianScheidt, @dflem97, @timcosta, @AidanHarveyNelson, @joar, @jmpfar, @jared-rimmer, @vesatoivonen, @briankravec, @saintamh, @tdurieux, @baa-ableton & @WillAyd who made their first contributions during the development of 2.0.0. Thanks for your contributions, and especially your patience in the slightly slower release of your efforts into the wild. 🙏🎉

What’s Changed

New Contributors

Don't miss a new sqlfluff release

NewReleases is sending notifications on new releases.