forked from sqlfluff/sqlfluff
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix bug where undefined Jinja variable in macro file crashes linter (s…
…qlfluff#3751) Co-authored-by: Barry Hart <[email protected]>
- Loading branch information
1 parent
d43e6c9
commit b720f98
Showing
6 changed files
with
26 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
test/fixtures/linter/autofix/ansi/macro_file_jinja_include_undefined_variable/.sqlfluff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[sqlfluff] | ||
dialect = ansi | ||
|
||
[sqlfluff:templater:jinja] | ||
load_macros_from_path = test/fixtures/linter/autofix/ansi/macro_file_jinja_include_undefined_variable/macros |
2 changes: 2 additions & 0 deletions
2
test/fixtures/linter/autofix/ansi/macro_file_jinja_include_undefined_variable/after.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
SELECT id | ||
FROM records |
3 changes: 3 additions & 0 deletions
3
test/fixtures/linter/autofix/ansi/macro_file_jinja_include_undefined_variable/before.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
SELECT | ||
id | ||
FROM records |
1 change: 1 addition & 0 deletions
1
...fixtures/linter/autofix/ansi/macro_file_jinja_include_undefined_variable/macros/utils.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{% include sql_file %} |
3 changes: 3 additions & 0 deletions
3
.../fixtures/linter/autofix/ansi/macro_file_jinja_include_undefined_variable/test-config.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
test-config: | ||
rules: | ||
- L036 |