forked from sqlfluff/sqlfluff
-
Notifications
You must be signed in to change notification settings - Fork 0
/
LT07.yml
102 lines (87 loc) · 1.9 KB
/
LT07.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
rule: LT07
test_pass_with_clause_closing_aligned:
# with statement indentation
pass_str: |
with cte as (
select 1
) select * from cte
test_pass_with_clause_closing_oneline:
# with statement oneline
pass_str: with cte as (select 1) select * from cte
test_pass_with_clause_closing_misaligned_indentation:
# Fix with statement indentation
pass_str: |
with cte as (
select 1
) select * from cte
test_pass_with_clause_closing_misaligned_negative_indentation:
# Fix with statement that has negative indentation
pass_str: |2
with cte as (
select 1
) select * from cte
test_move_parenthesis_to_next_line:
fail_str: |
with cte_1 as (
select foo
from tbl_1) -- Foobar
select cte_1.foo
from cte_1
fix_str: |
with cte_1 as (
select foo
from tbl_1
) -- Foobar
select cte_1.foo
from cte_1
test_pass_cte_with_column_list:
# Issue 2851: Ignore the CTE column list, only check the query.
pass_str: |
with
search_path (node_ids, total_time) as (
select 1
)
select * from search_path
test_pass_with_clause_closing_misaligned_indentation_in_templated_block:
pass_str: |
with
{% if true %}
cte as (
select 1
)
{% else %}
cte as (
select 2
)
{% endif %}
select * from cte
test_move_parenthesis_to_next_line_in_templated_block:
fail_str: |
with
{% if true %}
cte as (
select 1)
{% endif %}
select * from cte
fix_str: |
with
{% if true %}
cte as (
select 1
)
{% endif %}
select * from cte
test_pass_templated_clauses:
pass_str: |
with
{% for tbl in ['a', 'b'] %}
{{ tbl }} as (
SELECT 1
),
{% endfor %}
final as (
SELECT 1
)
select * from final
join a using (x)
join b using (x)