This release includes a couple of breaking changes to configuration and API methods. Specifically:
- Renamed the BaseCrawler class to BaseRule. This is the base class for all rules. This is a breaking change for any custom rules that have been added via plugins or by forking the SQLFluff repo.
- Renamed
sqlfluff.rules()tosqlfluff.list_rules()andsqlfluff.dialects()tosqlfluff.list_dialects()due to naming conflicts with the now separatesqlfluff.dialectsmodule. - Renamed
capitalisation_policytoextended_capitalisation_policyfor L014 to reflect the fact that it now accepts more options (pascal) than regularcapitalisation_policystill used by L010 and others. - Replaced
only_aliasesconfig withunquoted_identifiers_policyand added it to rule L014 in addition to L029.
Added
pascal(PascalCase)capitalisation_policyoption for L014 (unquoted identifiers)only_aliasesconfiguration option for L014 (unquoted identifers)- Dialects now have more advanced dependency options to allow less repetition between related dialects. The methods
get_segmentandget_grammarcan be used on unexpanded grammars to access elements of the parent grammars. Thecopymethod on grammars can be used to copy with alterations. - Rule L046 to line whitespace within jinja tags.
- Enable and Disable syntax for ignoring violations from ranges of lines.
Changed
- Extracted dialect definitions from the
sqlfluff.coremodule so that each dialect is better isolated from each other. This also allows more focused testing and the potential for dialect plugins in future. Dialects are now only imported as needed at runtime. All dialects should now be accessed using the selector methods insqlfluff.core.dialectsrather than importing fromsqlfluff.dialectsdirectly. - Add support for
ALTER USERcommands in Snowflake dialect. - Added describe statement to ANSI dialect
- Parse structure of
FROMclauses to better represent nested joins and table functions. - Parse structure of expressions to avoid unneccessary nesting and overly recursive method calls.