forked from sqlfluff/sqlfluff
-
Notifications
You must be signed in to change notification settings - Fork 0
/
LT02-indent.yml
2244 lines (2073 loc) · 46.1 KB
/
LT02-indent.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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
rule: LT02
test_fail_reindent_first_line_1:
fail_str: " SELECT 1"
fix_str: SELECT 1
violations:
- code: LT02
description: First line should not be indented.
name: layout.indent
warning: false
start_line_no: 1
start_line_pos: 1
start_file_pos: 0
end_line_no: 1
end_line_pos: 6
end_file_pos: 5
fixes:
- edit: ''
end_file_pos: 5
end_line_no: 1
end_line_pos: 6
start_file_pos: 0
start_line_no: 1
start_line_pos: 1
type: delete
test_fail_reindent_first_line_2:
# Github Bug #99. Python2 Issues with fixing LT02
fail_str: " select 1 from tbl;"
fix_str: select 1 from tbl;
test_pass_indentation_of_comments_1:
# Github Bug #203
# Comments should be aligned to the following line.
pass_str: |
SELECT
-- Compute the thing
(a + b) AS c
FROM
acceptable_buckets
test_pass_indentation_of_comments_2:
# Comments should be aligned to the following line.
pass_str: |
SELECT
user_id
FROM
age_data
JOIN
audience_size
USING (user_id, list_id)
-- We LEFT JOIN because blah
LEFT JOIN
verts
USING
(user_id)
test_fail_tab_indentation:
# Using tabs as indents works
fail_str: |
SELECT
a,
b
FROM my_tbl
fix_str: |
SELECT
a,
b
FROM my_tbl
configs:
indentation:
indent_unit: tab
violations:
- code: LT02
description: Expected indent of 1 tabs.
name: layout.indent
warning: false
start_line_no: 3
start_line_pos: 1
start_file_pos: 11
end_line_no: 3
end_line_pos: 2
end_file_pos: 12
fixes:
- edit: "\n\t"
end_file_pos: 11
end_line_no: 3
end_line_pos: 1
start_file_pos: 10
start_line_no: 2
start_line_pos: 4
type: replace
test_pass_indented_joins_default:
# Configurable indents work.
# a) default
pass_str: |
SELECT a, b, c
FROM my_tbl
LEFT JOIN another_tbl USING(a)
test_pass_indented_joins_false:
# b) specific
pass_str: |
SELECT a, b, c
FROM my_tbl
LEFT JOIN another_tbl USING(a)
configs:
indentation:
indented_joins: false
test_pass_indented_joins_true:
# c) specific True, but passing
pass_str: |
SELECT a, b, c
FROM my_tbl
LEFT JOIN another_tbl USING(a)
configs:
indentation:
indented_joins: true
test_fail_indented_joins_true_fix:
# d) specific True, but failing
fail_str: |
SELECT a, b, c
FROM my_tbl
LEFT JOIN another_tbl USING(a)
fix_str: |
SELECT a, b, c
FROM my_tbl
LEFT JOIN another_tbl USING(a)
configs:
indentation:
indented_joins: true
violations:
- code: LT02
description: Expected indent of 4 spaces.
name: layout.indent
warning: false
start_line_no: 3
start_line_pos: 1
start_file_pos: 27
end_line_no: 3
end_line_pos: 5
end_file_pos: 31
fixes:
- edit: "\n "
end_file_pos: 27
end_line_no: 3
end_line_pos: 1
start_file_pos: 26
start_line_no: 2
start_line_pos: 12
type: replace
test_fail_indented_joins_false_fix:
# e) specific False, and failing
fail_str: |
SELECT a, b, c
FROM my_tbl
LEFT JOIN another_tbl USING(a)
fix_str: |
SELECT a, b, c
FROM my_tbl
LEFT JOIN another_tbl USING(a)
configs:
indentation:
indented_joins: false
test_pass_indented_using_on_default:
# Configurable using_on indents work.
# 2.a) default
pass_str: |
SELECT a, b, c
FROM my_tbl
LEFT JOIN another_tbl
USING(a)
test_pass_indented_using_on_true:
# 2.b) specific
pass_str: |
SELECT a, b, c
FROM my_tbl
LEFT JOIN another_tbl
USING(a)
configs:
indentation:
indented_joins: true
indented_using_on: true
test_pass_indented_using_on_false:
# 2.c) specific False, but passing
pass_str: |
SELECT a, b, c
FROM my_tbl
LEFT JOIN another_tbl
USING(a)
configs:
indentation:
indented_joins: true
indented_using_on: false
test_fail_indented_using_on_false:
# 2.d) specific False, but failing
fail_str: |
SELECT a, b, c
FROM my_tbl
LEFT JOIN another_tbl
USING(a)
fix_str: |
SELECT a, b, c
FROM my_tbl
LEFT JOIN another_tbl
USING(a)
configs:
indentation:
indented_joins: true
indented_using_on: false
test_fail_indented_joins_using_on_true:
# 2.e) specific True, and failing
fail_str: |
SELECT a, b, c
FROM my_tbl
LEFT JOIN another_tbl
USING(a)
fix_str: |
SELECT a, b, c
FROM my_tbl
LEFT JOIN another_tbl
USING(a)
configs:
indentation:
indented_joins: true
indented_using_on: true
test_fail_indented_joins_using_on_false:
# 2.f) specific false for both, and failing
fail_str: |
SELECT a, b, c
FROM my_tbl
LEFT JOIN another_tbl
USING(a)
fix_str: |
SELECT a, b, c
FROM my_tbl
LEFT JOIN another_tbl
USING(a)
configs:
indentation:
indented_joins: false
indented_using_on: false
test_fail_indented_using_on_merge_statment_default:
# indented_using_on also covers MERGE INTO statements
fail_str: |
MERGE INTO t
USING u
ON t.a = u.b
WHEN MATCHED THEN
UPDATE SET a = 1
fix_str: |
MERGE INTO t
USING u
ON t.a = u.b
WHEN MATCHED THEN
UPDATE SET a = 1
test_pass_indented_using_on_merge_statment_false:
# indented_using_on also covers MERGE INTO statements
pass_str: |
MERGE INTO t
USING u
ON t.a = u.b
WHEN MATCHED THEN
UPDATE SET a = 1
configs:
indentation:
indented_using_on: false
test_pass_indented_on_contents_default:
# Test indented_on_contents when default (true)
pass_str: |
SELECT
r.a,
s.b
FROM r
JOIN s
ON
r.a = s.a
AND true
test_pass_indented_on_contents_true:
# Test indented_on_contents when true (default)
fail_str: |
SELECT
r.a,
s.b
FROM r
JOIN s
ON r.a = s.a
AND true
fix_str: |
SELECT
r.a,
s.b
FROM r
JOIN s
ON
r.a = s.a
AND true
configs:
indentation:
indented_on_contents: true
test_pass_indented_on_contents_false:
# Test indented_on_contents when false (non-default)
pass_str: |
SELECT
r.a,
s.b
FROM r
JOIN s
ON r.a = s.a
AND true
configs:
indentation:
indented_on_contents: false
test_fail_indented_on_contents_default_fix_a:
# Default config for indented_on_contents is true
fail_str: |
SELECT *
FROM t1
JOIN t2
ON true
AND true
fix_str: |
SELECT *
FROM t1
JOIN t2
ON
true
AND true
test_fail_indented_on_contents_default_fix_b:
# Default config for indented_on_contents is true.
# This is an alternate interpretation of untaken indents.
fail_str: |
SELECT *
FROM t1
JOIN t2 ON true
AND true
fix_str: |
SELECT *
FROM t1
JOIN t2 ON
true
AND true
test_fail_indented_on_contents_false_fix:
fail_str: |
SELECT
t1.a,
t2.b
FROM t1
JOIN t2
ON true
AND true
fix_str: |
SELECT
t1.a,
t2.b
FROM t1
JOIN t2
ON true
AND true
configs:
indentation:
indented_on_contents: false
test_pass_indented_from_with_comment:
pass_str: |
SELECT *
FROM
t1
-- Comment
JOIN t2 USING (user_id)
test_pass_ignored_comment:
# Test ignoring comments entirely.
# https://github.com/sqlfluff/sqlfluff/issues/3311
pass_str: |
SELECT *
FROM
t1
-- Comment
JOIN t2 USING (user_id)
configs:
indentation:
ignore_comment_lines: true
test_fail_indented_from_with_comment_alternate:
# This shows the alternative position of comments being allowed.
pass_str: |
SELECT *
FROM
t1
-- Comment
JOIN t2 USING (user_id)
test_fail_indented_from_with_comment_fix:
# This shows the fix still returns to the primary location.
fail_str: |
SELECT *
FROM
t1
-- Comment
JOIN t2 USING (user_id)
fix_str: |
SELECT *
FROM
t1
-- Comment
JOIN t2 USING (user_id)
test_fail_indented_multi_line_comment:
fail_str: |
SELECT
business_type,
-- The following is the slope of the regression line. Note that CORR (which is the Pearson's correlation
-- coefficient is symmetric in its arguments, but since STDDEV_POP(open_rate_su) appears in the
customer_type
FROM
global_actions_states
fix_str: |
SELECT
business_type,
-- The following is the slope of the regression line. Note that CORR (which is the Pearson's correlation
-- coefficient is symmetric in its arguments, but since STDDEV_POP(open_rate_su) appears in the
customer_type
FROM
global_actions_states
test_jinja_with_disbalanced_pairs:
# The range(3) -%} results in swallowing the \n
# N.B. The way LT02 handles this is questionable,
# and this test seals in that behaviour.
pass_str: |
SELECT
cohort_month
{% for i in range(3) -%}
, {{ i }} AS index_{{ i }}
{% endfor -%}
, TRUE AS overall
FROM orders
test_fail_attempted_hanger_fix:
# Check messy hanger correction.
fail_str: |
SELECT coalesce(foo,
bar)
FROM tbl
fix_str: |
SELECT
coalesce(
foo,
bar
)
FROM tbl
test_fail_possible_hanger_fix:
# Same note as above, but with a messier example.
fail_str: |
SELECT coalesce(foo,
bar)
FROM tbl
fix_str: |
SELECT
coalesce(
foo,
bar
)
FROM tbl
test_fail_consecutive_hangers:
fail_str: |
select *
from foo
where a like 'a%'
and b like 'b%'
and c like 'c%'
and d like 'd%'
and e like 'e%'
and f like 'f%'
fix_str: |
select *
from foo
where
a like 'a%'
and b like 'b%'
and c like 'c%'
and d like 'd%'
and e like 'e%'
and f like 'f%'
test_fail_consecutive_hangers_implicit:
# NOTE: The allowed implicit indent in the WHERE clause,
# but by default they're not enabled.
fail_str: |
select *
from foo
where a like 'a%'
and b like 'b%'
and c like 'c%'
and d like 'd%'
and e like 'e%'
and f like 'f%'
fix_str: |
select *
from foo
where a like 'a%'
and b like 'b%'
and c like 'c%'
and d like 'd%'
and e like 'e%'
and f like 'f%'
configs:
indentation:
allow_implicit_indents: true
test_fail_clean_reindent_fix:
# A "clean" indent is where the previous line ends with an
# indent token (as per this example). We should use the
# default approach and indent by 1 step.
# NOTE: That because the indent opened before "coalesce"
# isn't closed before the end of the line, we force an
# additional indent before it.
fail_str: |
SELECT coalesce(
foo,
bar)
FROM tbl
fix_str: |
SELECT
coalesce(
foo,
bar
)
FROM tbl
# https://github.com/sqlfluff/sqlfluff/issues/643
test_pass_indent_snowflake:
pass_str: |
with source_data as (
select * from {{ source('source_name', 'xxx_yyy_zzz') }}
)
select *
from source_data
configs:
core:
dialect: snowflake
# https://github.com/sqlfluff/sqlfluff/issues/643
test_pass_indent_indent_bigquery:
pass_str: |
with source_data as (
select * from {{ source('source_name', 'xxx_yyy_zzz') }}
)
select *
from source_data
configs:
core:
dialect: bigquery
test_jinja_indent_templated_table_name_a:
fail_str: |
-- This file combines product data from individual brands into a staging table
{% for product in ['table1', 'table2'] %}
SELECT
brand,
country_code,
category,
name,
id
FROM
{{ product }}
{% if not loop.last -%} UNION ALL {%- endif %}
{% endfor %}
fix_str: |
-- This file combines product data from individual brands into a staging table
{% for product in ['table1', 'table2'] %}
SELECT
brand,
country_code,
category,
name,
id
FROM
{{ product }}
{% if not loop.last -%} UNION ALL {%- endif %}
{% endfor %}
# Like test_jinja_indent_1_a but "FROM" table not initially
# indented.
test_jinja_indent_templated_table_name_b:
fail_str: |
-- This file combines product data from individual brands into a staging table
{% for product in ['table1', 'table2'] %}
SELECT
brand,
country_code,
category,
name,
id
FROM
{{ product }}
{% if not loop.last -%} UNION ALL {%- endif %}
{% endfor %}
fix_str: |
-- This file combines product data from individual brands into a staging table
{% for product in ['table1', 'table2'] %}
SELECT
brand,
country_code,
category,
name,
id
FROM
{{ product }}
{% if not loop.last -%} UNION ALL {%- endif %}
{% endfor %}
test_jinja_nested_blocks:
fail_str: |
WITH
raw_effect_sizes AS (
SELECT
{% for action in ['a'] %}
{% if True %}
rate_su_{{action}},
{% endif %}
{% endfor %}
)
SELECT 1
fix_str: |
WITH
raw_effect_sizes AS (
SELECT
{% for action in ['a'] %}
{% if True %}
rate_su_{{action}},
{% endif %}
{% endfor %}
)
SELECT 1
# LIMIT, QUALIFY, and WINDOW both indent
test_limit_and_qualify_and_window_indent:
fail_str: |
SELECT
a,
b
FROM
my_tbl
QUALIFY
1
LIMIT
1
WINDOW
some_window AS (PARTITION BY 1)
fix_str: |
SELECT
a,
b
FROM
my_tbl
QUALIFY
1
LIMIT
1
WINDOW
some_window AS (PARTITION BY 1)
configs:
core:
dialect: bigquery
# LIMIT, QUALIFY and WINDOW both acceptable on single line
test_limit_and_qualify_and_window_single_line:
pass_str: |
SELECT
a,
b
FROM
my_tbl
QUALIFY 1
LIMIT 1
WINDOW some_window AS (PARTITION BY 1)
configs:
core:
dialect: bigquery
# By default CTEs should not be indented
test_pass_cte:
pass_str: |
WITH
some_cte AS (
SELECT 1 FROM table1
),
some_other_cte AS (
SELECT 1 FROM table1
)
SELECT 1 FROM table1
configs:
core:
dialect: bigquery
# CTEs can be configured to be indented
test_fail_indented_cte:
fail_str: |
WITH
some_cte AS (
SELECT 1 FROM table1
),
some_other_cte AS (
SELECT 1 FROM table1
)
SELECT 1 FROM table1
fix_str: |
WITH
some_cte AS (
SELECT 1 FROM table1
),
some_other_cte AS (
SELECT 1 FROM table1
)
SELECT 1 FROM table1
configs:
core:
dialect: bigquery
indentation:
indented_ctes: true
# Exasol LUA script
test_exasol_script:
pass_str: |
CREATE OR REPLACE LUA SCRIPT ASCRIPT (APARAM) RETURNS ROWCOUNT AS
res = 1
suc = true
if not suc then
error("ERROR")
end
return res
/
configs:
core:
dialect: exasol
test_pass_tsql_else_if:
pass_str: |
IF (1 > 1)
PRINT 'A';
ELSE IF (2 > 2)
PRINT 'B';
ELSE IF (3 > 3)
PRINT 'C';
ELSE
PRINT 'D';
configs:
core:
dialect: tsql
test_fail_tsql_else_if:
fail_str: |
IF (1 > 1)
PRINT 'A';
ELSE IF (2 > 2)
PRINT 'B';
ELSE IF (3 > 3)
PRINT 'C';
ELSE
PRINT 'D';
fix_str: |
IF (1 > 1)
PRINT 'A';
ELSE IF (2 > 2)
PRINT 'B';
ELSE IF (3 > 3)
PRINT 'C';
ELSE
PRINT 'D';
configs:
core:
dialect: tsql
test_fail_tsql_else_if_successive:
fail_str: |
IF (1 > 1)
PRINT 'A';
ELSE IF (2 > 2)
PRINT 'B';
ELSE IF (3 > 3)
PRINT 'C';
ELSE
PRINT 'D';
fix_str: |
IF (1 > 1)
PRINT 'A';
ELSE IF (2 > 2)
PRINT 'B';
ELSE IF (3 > 3)
PRINT 'C';
ELSE
PRINT 'D';
configs:
core:
dialect: tsql
# TSQL function
test_tsql_function:
fail_str: |
CREATE FUNCTION dbo.isoweek (@DATE datetime)
RETURNS int
WITH EXECUTE AS CALLER
AS
BEGIN
DECLARE @ISOweek int;
SET @ISOweek = DATEPART(wk, @DATE) + 1
- DATEPART(wk, CAST(DATEPART(yy, @DATE) AS char(4)) + '0104');
--Special cases Jan 1-3 may belong to the previous year
IF (@ISOweek = 0)
SET @ISOweek = dbo.ISOWEEK(CAST(DATEPART(yy, @DATE) - 1
AS char(4)
) + '12' + CAST(24 + DATEPART(day, @DATE) AS char(2))) + 1;
--Special case Dec 29-31 may belong to the next year
IF ((DATEPART(mm, @DATE) = 12)
AND ((DATEPART(dd, @DATE) - DATEPART(dw, @DATE)) >= 28))
SET @ISOweek = 1;
RETURN(@ISOweek);
END;
GO
fix_str: |
CREATE FUNCTION dbo.isoweek (@DATE datetime)
RETURNS int
WITH EXECUTE AS CALLER
AS
BEGIN
DECLARE @ISOweek int;
SET
@ISOweek = DATEPART(wk, @DATE) + 1
- DATEPART(wk, CAST(DATEPART(yy, @DATE) AS char(4)) + '0104');
--Special cases Jan 1-3 may belong to the previous year
IF (@ISOweek = 0)
SET @ISOweek = dbo.ISOWEEK(CAST(
DATEPART(yy, @DATE) - 1
AS char(4)
) + '12' + CAST(24 + DATEPART(day, @DATE) AS char(2))) + 1;
--Special case Dec 29-31 may belong to the next year
IF (
(DATEPART(mm, @DATE) = 12)
AND ((DATEPART(dd, @DATE) - DATEPART(dw, @DATE)) >= 28)
)
SET @ISOweek = 1;
RETURN(@ISOweek);
END;
GO
configs:
core:
dialect: tsql
test_pass_ignore_templated_whitespace:
pass_str: |
SELECT
c1,
{{ " c2" }}
FROM my_table
configs:
core:
ignore_templated_areas: false
test_fail_ignore_templated_whitespace_1:
fail_str: |
SELECT
c1,
d{{ " c2" }}
FROM my_table
fix_str: |
SELECT
c1,
d{{ " c2" }}
FROM my_table
configs:
core:
ignore_templated_areas: false
test_fail_ignore_templated_whitespace_2:
fail_str: |
SELECT
c1,
d{{ " c2" }}
FROM my_table
fix_str: |
SELECT
c1,
d{{ " c2" }}
FROM my_table
configs:
core:
ignore_templated_areas: false
test_fail_ignore_templated_whitespace_3:
fail_str: |
SELECT
c1,
d{{ " c2" }}
FROM my_table
fix_str: |
SELECT
c1,
d{{ " c2" }}
FROM my_table
configs:
core:
ignore_templated_areas: false
test_pass_ignore_templated_whitespace_4:
# Note the newline after c2. This causes "AS other_id" to be on a different
# line in templated space, but not raw space. LT02 should ignore lines like
# this.
pass_str: |
SELECT
c1,
{{ " c2\n" }} AS other_id
FROM my_table
test_pass_ignore_templated_newline_not_last_line:
pass_str: |
select *
from {{ "\n\nmy_table" }}
inner join
my_table2
using (id)
test_pass_ignore_templated_newline_last_line:
pass_str: |
select *
from {{ "\n\nmy_table" }}
test_fail_fix_template_indentation_1:
fail_str: |
SELECT
c1,
{{ "c2" }}
fix_str: |
SELECT
c1,
{{ "c2" }}
test_fail_fix_template_indentation_2:
fail_str: |
with
first_join as (
select
{{ "c1" }},
c2
from helper
{{ "group by 1" }}
)
select * from first_join
fix_str: |
with
first_join as (
select
{{ "c1" }},
c2
from helper
{{ "group by 1" }}
)
select * from first_join
test_pass_tsql_update_indent:
pass_str: |
update Extracts.itt_parm_base
set