forked from sqlfluff/sqlfluff
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJJ01.yml
60 lines (49 loc) · 1.65 KB
/
JJ01.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
rule: JJ01
test_simple:
pass_str: SELECT 1 from {{ ref('foo') }}
test_simple_modified:
# Test that the plus/minus notation works fine.
pass_str: SELECT 1 from {%+ if true -%} foo {%- endif %}
test_simple_modified_fail:
# Test that the plus/minus notation works fine.
fail_str: SELECT 1 from {%+if true-%} {{ref('foo')}} {%-endif%}
fix_str: SELECT 1 from {%+ if true -%} {{ ref('foo') }} {%- endif %}
test_fail_jinja_tags_no_space:
fail_str: SELECT 1 from {{ref('foo')}}
fix_str: SELECT 1 from {{ ref('foo') }}
test_fail_jinja_tags_multiple_spaces:
fail_str: SELECT 1 from {{ ref('foo') }}
fix_str: SELECT 1 from {{ ref('foo') }}
test_fail_jinja_tags_no_space_2:
fail_str: SELECT 1 from {{+ref('foo')-}}
fix_str: SELECT 1 from {{+ ref('foo') -}}
test_pass_newlines:
# It's ok if there are newlines.
pass_str:
SELECT 1 from {{
ref('foo')
}}
test_fail_templated_segment_contains_leading_literal:
fail_str: |
SELECT user_id
FROM
`{{"gcp_project"}}.{{"dataset"}}.campaign_performance`
fix_str: |
SELECT user_id
FROM
`{{ "gcp_project" }}.{{ "dataset" }}.campaign_performance`
configs:
core:
dialect: bigquery
test_fail_segment_contains_multiple_templated_slices_last_one_bad:
fail_str: CREATE TABLE `{{ "project" }}.{{ "dataset" }}.{{"table"}}`
fix_str: CREATE TABLE `{{ "project" }}.{{ "dataset" }}.{{ "table" }}`
configs:
core:
dialect: bigquery
test_fail_jinja_tags_no_space_no_content:
fail_str: SELECT {{""-}}1
fix_str: SELECT {{ "" -}}1
test_fail_jinja_tags_across_segment_boundaries:
fail_str: SELECT a{{-"1 + b"}}2
fix_str: SELECT a{{- "1 + b" }}2