tconbeer / sqlfmt

sqlfmt formats your dbt SQL files so you don't have to
https://sqlfmt.com
Apache License 2.0
390 stars 16 forks source link

fix #471: handle nested dictionary in jinja expression #507

Closed benjamin-awd closed 10 months ago

benjamin-awd commented 10 months ago

Tried to raise a draft PR for 471 --

I realized a simple solution is simply to exclude "}} from the jinja end expression using a negative lookbehind

Seems like it plays nice with the existing test suite, but this doesn't cover triple nested dictionaries like }}}" (unless I add another negative lookbehind)

And also there's the possibility of jinja strings like so {{"foo"}} that will be impacted by this.

So I've closed this PR, since it doesn't qualify as a working solution.