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

Intendeation in run directive breaking code - simple declarations #197

Open
gordonkoehn opened this issue Jul 20, 2023 · 2 comments
Open
Labels
bug Something isn't working

Comments

@gordonkoehn
Copy link

When running snakefmt on the following rule the alpha and line_style declarations are intended for no reason.

This breaks the code obviously. No idea what could trigger this behaviour.

Is there anything I am doing wrong in the declaration of variables here?

Original:

    run
       ....
                 # Define the list of colors to repeat
                  colors = {"h": "red", "s": "green", "d": "blue", "r": "orange", "m": "purple"}
                  labels = {
                      "h": "Huntress",
                          "s": "Star",
                          "d": "Deep",
                          "r": "Random",
                          "m": "MCMC5",
                      }
            
                  # Define opacity and line style
                  alpha = 0.6
                  line_style = "solid"
            
                  # Plot each entry of distance chain as a line with a color unique to the
                  # initial tree type onto one axis
            
                  # Plot each entry of distance chain as a line with a color unique to the
                  # initial tree type onto one axis
                  for i, distances in enumerate(distances_chains):
        ...

Reformated:

    run
       ....
                 # Define the list of colors to repeat
                  colors = {"h": "red", "s": "green", "d": "blue", "r": "orange", "m": "purple"}
                  labels = {
                      "h": "Huntress",
                          "s": "Star",
                          "d": "Deep",
                          "r": "Random",
                          "m": "MCMC5",
                      }
            
                            # Define opacity and line style
                            alpha = 0.6
                            line_style = "solid"
            
                  # Plot each entry of distance chain as a line with a color unique to the
                  # initial tree type onto one axis
            
                  # Plot each entry of distance chain as a line with a color unique to the
                  # initial tree type onto one axis
                  for i, distances in enumerate(distances_chains):
        ...
@mbhall88
Copy link
Member

You're not doing anything wrong. We've just had a lot of trouble trying to manage run directives with comments in them. The short term solution would be to move this code into a script directive (I think this is generally the snakemake suggested method). Brice and I are struggling to maintain this repo currently so we may not get around to it for a little while sorry

@gordonkoehn
Copy link
Author

Thanks for your response! I see. Thanks for the suggestion.

Keep up the good work! Was really excited to find Snakefmt - will keep watching your repo :)

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

2 participants