question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

snakefmt adds wrong indentation

See original GitHub issue

It looks like snakefmt 0.4.4 adds wrong indentations when formatting a snakemake rule containing a if-else-closure.

As an example the following output will be created for a proper formatted rule:

--- original
+++ new
     params:
         datasources=(
             "-s {}".format(" ".join(config["annotations"]["dgidb"]["datasources"]))
-            if config["annotations"]["dgidb"].get("datasources", "")
-            else ""
+        if config["annotations"]["dgidb"].get("datasources", "")
+        else ""
         ),
     output:
         "results/calls/{prefix}.dgidb.bcf",

A minimal example is attached. Snakefile.zip

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
corneliusroemercommented, Sep 6, 2022

I think this label could get a help wanted label? Assuming it’s doable for a non-maintainer to tackle.

0reactions
mbhall88commented, Dec 8, 2022

I wonder if anyone would like to test out #164 as that fixes the two examples in this issue?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Indentation Error in Python | How to Solve it - Edureka
This article will provide you with a detailed understanding of Indentation error in Python and the solutions to avoid the same.
Read more >
snakefmt - PyPI
As snakefmt has a Conda recipe, there is a matching image built for each version by Biocontainers. ... Return code 123 means there...
Read more >
Documentation - Doom Emacs v21.12 documentation
This module adds text rotation; the ability to cycle through keywords or text patterns at point. e.g. Swapping true and false . 7.5.11....
Read more >
Formatting convention (#43) · Issues · IMP / IMP3 · GitLab
automatic formatter: Snakefmt, based on Black. References: ... add comments where possible; one place for all helper functions.
Read more >
تويتر \ Brice Letcher على تويتر: "Snakefmt version 0.2.4 https://t ...
(better error handling in vim plugin) and jfear (version control ... Added pre-commit hook integration (@jfear) [#81] Fixed Proper indentation of nested ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found