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.dialects
module. - Renamed
capitalisation_policy
toextended_capitalisation_policy
for L014 to reflect the fact that it now accepts more options (pascal
) than regularcapitalisation_policy
still used by L010 and others. - Replaced
only_aliases
config withunquoted_identifiers_policy
and added it to rule L014 in addition to L029.
Added
pascal
(PascalCase)capitalisation_policy
option for L014 (unquoted identifiers)only_aliases
configuration option for L014 (unquoted identifers)- Dialects now have more advanced dependency options to allow less repetition between related dialects. The methods
get_segment
andget_grammar
can be used on unexpanded grammars to access elements of the parent grammars. Thecopy
method 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.core
module 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.dialects
rather than importing fromsqlfluff.dialects
directly. - Add support for
ALTER USER
commands in Snowflake dialect. - Added describe statement to ANSI dialect
- Parse structure of
FROM
clauses to better represent nested joins and table functions. - Parse structure of expressions to avoid unneccessary nesting and overly recursive method calls.