snakefmt icon indicating copy to clipboard operation
snakefmt copied to clipboard

empty named entry in parameter list is deleted

Open Hugovdberg opened this issue 3 years ago • 1 comments

When a parameter_list contains a empty named entry it is deleted by snakefmt upon formatting if there are other entries. Somewhat related to #104.

rule foo:
    input:
        bar="fileA.data",
        baz=

is formatted to

rule foo:
    input:
        bar="fileA.data",

But if the bar entry wasn't there the same error is raised as in #104.

This is not a really big issue, although it produces some unexpected results if you have Visual Studio Code setup to autoformat on save and a save is triggered (in my case because of an autosave on context change). I understand empty lines are deleted, but I think this should be a grammar error instead of simply deleting the line.

Hugovdberg avatar Dec 06 '21 08:12 Hugovdberg

Thanks for spotting @Hugovdberg , I agree an error should be raised here

bricoletc avatar Dec 06 '21 10:12 bricoletc