Skip to content

Commit

Permalink
Merge branch 'main' into snowsql-variables-with-curly-brackets
Browse files Browse the repository at this point in the history
  • Loading branch information
barrywhart committed Nov 20, 2021
2 parents 0e69de4 + c66aefd commit 905752b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/sqlfluff/cli/commands.py
Expand Up @@ -305,7 +305,7 @@ def get_linter_and_formatter(
return Linter(config=cfg), formatter


@click.group()
@click.group(context_settings={"help_option_names": ["-h", "--help"]})
@click.version_option()
def cli():
"""Sqlfluff is a modular sql linter for humans."""
Expand Down
19 changes: 10 additions & 9 deletions src/sqlfluff/rules/L031.py
Expand Up @@ -8,6 +8,15 @@
from sqlfluff.core.rules.doc_decorators import document_fix_compatible


class TableAliasInfo(NamedTuple):
"""Structure yielded by_filter_table_expressions()."""

table_ref: BaseSegment
whitespace_ref: BaseSegment
alias_exp_ref: BaseSegment
alias_identifier_ref: BaseSegment


@document_fix_compatible
class Rule_L031(BaseRule):
"""Avoid table aliases in from clauses and join conditions.
Expand Down Expand Up @@ -102,14 +111,6 @@ def _eval(self, context: RuleContext) -> Optional[LintResult]:
)
return None

class TableAliasInfo(NamedTuple):
"""Structure yielded by_filter_table_expressions()."""

table_ref: BaseSegment
whitespace_ref: BaseSegment
alias_exp_ref: BaseSegment
alias_identifier_ref: BaseSegment

@classmethod
def _filter_table_expressions(
cls, base_table, from_expression_elements
Expand Down Expand Up @@ -142,7 +143,7 @@ def _filter_table_expressions(
continue

alias_identifier_ref = alias_exp_ref.get_child("identifier")
yield cls.TableAliasInfo(
yield TableAliasInfo(
table_ref, whitespace_ref, alias_exp_ref, alias_identifier_ref
)

Expand Down

0 comments on commit 905752b

Please sign in to comment.