Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Unstable indentation for multiline jinja #138

Closed
tconbeer opened this issue Feb 25, 2022 · 1 comment
Closed

Bug: Unstable indentation for multiline jinja #138

tconbeer opened this issue Feb 25, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@tconbeer
Copy link
Owner

Describe the bug
Sometimes sqlfmt increases the indentation on a mulitline jinja tag when it's run multiple times.

To Reproduce

with
    base_spine as (
        {{
            dbt_utils.date_spine(
                datepart="day",
                start_date="'2021-01-01'::date",
                end_date="sysdate() + interval '1 year'"
            )
        }}
    ),

Expected behavior

with
    base_spine as (
        {{
            dbt_utils.date_spine(
                datepart="day",
                start_date="'2021-01-01'::date",
                end_date="sysdate() + interval '1 year'"
            )
        }}
    ),

Actual behavior

with
    base_spine as (
        {{
            dbt_utils.date_spine(
                                                    datepart="day",
                                                    start_date="'2021-01-01'::date",
                                                    end_date="sysdate() + interval '1 year'"
                                                )
        }}
    ),

Additional context
What is the output of sqlfmt --version?
0.5.1

@tconbeer tconbeer added the bug Something isn't working label Feb 25, 2022
@tconbeer
Copy link
Owner Author

This only happens when black is not installed or the --no-jinjafmt option is used

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant