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

Nested if statment looses indent. #78

Closed
jfear opened this issue Oct 27, 2020 · 1 comment
Closed

Nested if statment looses indent. #78

jfear opened this issue Oct 27, 2020 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@jfear
Copy link
Contributor

jfear commented Oct 27, 2020

Thanks for a really nice tool.

I have noticed an edge case, nested if statements are losing their indention level. Perhaps related to #40

Given

if config["a"] is None:
    include: "module_a_none.smk"

    if config["b"] is None:
        include: "module_b.smk"
    else:
        include: "module_c.smk"

else:
    include: "module_a.smk"

I get

if config["a"] is None:

    include: "module_a_none.smk"


if config["b"] is None:

        include: "module_b.smk"


else:

        include: "module_c.smk"


else:

    include: "module_a.smk"

Notice how the nested if and else are unindented, but the nested includes are at the correct indention level.

# Name                    Version                   Build  Channel
black                     19.10b0                  py38_0    conda-forge
python                    3.8.6           h852b56e_0_cpython    conda-forge
snakefmt                  0.2.3                      py_0    bioconda
@bricoletc bricoletc added the bug Something isn't working label Nov 1, 2020
@bricoletc bricoletc self-assigned this Nov 1, 2020
bricoletc added a commit to bricoletc/snakefmt that referenced this issue Nov 10, 2020
Nested if/else python code interleaved with snakemake keywords were
losing indentation. Add a fix, with unit test.
bricoletc added a commit to bricoletc/snakefmt that referenced this issue Nov 11, 2020
Nested if/else python code interleaved with snakemake keywords were
losing indentation. Add a fix, with unit test.
@bricoletc bricoletc mentioned this issue Nov 11, 2020
mbhall88 pushed a commit that referenced this issue Nov 12, 2020
Nested if/else python code interleaved with snakemake keywords were
losing indentation. Add a fix, with unit test.
mbhall88 pushed a commit that referenced this issue Nov 12, 2020
Nested if/else python code interleaved with snakemake keywords were
losing indentation. Add a fix, with unit test.
@mbhall88
Copy link
Member

This should be fixed in v0.2.4 now @jfear . Let us know if you still have issues.

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

3 participants