forked from sqlfluff/sqlfluff
-
Notifications
You must be signed in to change notification settings - Fork 0
/
LT13.yml
49 lines (36 loc) · 1.73 KB
/
LT13.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
rule: LT13
test_pass_leading_whitespace_statement:
pass_str: "SELECT foo FROM bar\n"
test_pass_leading_whitespace_comment:
pass_str: "/*I am a comment*/\nSELECT foo FROM bar\n"
test_pass_leading_whitespace_inline_comment:
pass_str: "--I am a comment\nSELECT foo FROM bar\n"
test_pass_leading_whitespace_inline_comment_hash:
pass_str: "# I am a comment\nSELECT foo FROM bar\n"
configs:
core:
dialect: bigquery
test_pass_leading_whitespace_jinja_comment:
pass_str: "{# I am a comment #}\nSELECT foo FROM bar\n"
test_pass_leading_whitespace_jinja_if:
pass_str: "{% if True %}\nSELECT foo\nFROM bar;\n{% endif %}\n"
test_pass_leading_whitespace_jinja_for:
pass_str: "{% for item in range(10) %}\nSELECT foo_{{ item }}\nFROM bar;\n{% endfor %}\n"
test_fail_leading_whitespace_statement:
fail_str: "\n SELECT foo FROM bar\n"
fix_str: "SELECT foo FROM bar\n"
test_fail_leading_whitespace_comment:
fail_str: "\n /*I am a comment*/\nSELECT foo FROM bar\n"
fix_str: "/*I am a comment*/\nSELECT foo FROM bar\n"
test_fail_leading_whitespace_inline_comment:
fail_str: "\n --I am a comment\nSELECT foo FROM bar\n"
fix_str: "--I am a comment\nSELECT foo FROM bar\n"
test_fail_leading_whitespace_jinja_comment:
fail_str: "\n {# I am a comment #}\nSELECT foo FROM bar\n"
fix_str: "{# I am a comment #}\nSELECT foo FROM bar\n"
test_fail_leading_whitespace_jinja_if:
fail_str: "\n {% if True %}\nSELECT foo\nFROM bar;\n{% endif %}\n"
fix_str: "{% if True %}\nSELECT foo\nFROM bar;\n{% endif %}\n"
test_fail_leading_whitespace_jinja_for:
fail_str: "\n {% for item in range(10) %}\nSELECT foo_{{ item }}\nFROM bar;\n{% endfor %}\n"
fix_str: "{% for item in range(10) %}\nSELECT foo_{{ item }}\nFROM bar;\n{% endfor %}\n"