snakemake / snakefmt

The uncompromising Snakemake code formatter
MIT License
153 stars 29 forks source link

Snakefmt fails when config file is missing #139

Closed GiulioCentorame closed 2 years ago

GiulioCentorame commented 2 years ago

Hi there, I am using snakefmt as part of super-linter and I noticed the snakefmt run fails whenever it cannot find my configfile:

------
WorkflowError in line 3 of /github/workspace/Snakefile:
Workflow defines configfile config.json but it is not present or accessible.
  File "/github/workspace/Snakefile", line 3, in <module>
------

This is technically unwanted behaviour for me, as config.json is in my .gitignore (it contains all the system-specific path for my project), is there a way of skipping or getting around this check while running snakefmt? Thanks!

mbhall88 commented 2 years ago

I think this is probably coming from snakemake --lint, not snakefmt

https://github.com/snakemake/snakemake/blob/ccddf98521774bb7a6662c3a0b0b8dcf6e8a31de/snakemake/workflow.py#L1280-L1284

GiulioCentorame commented 2 years ago

Got it, thanks! Will open it on snakemake