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

Which keywords can occur more than once? #27

Closed
bricoletc opened this issue Apr 10, 2020 · 6 comments
Closed

Which keywords can occur more than once? #27

bricoletc opened this issue Apr 10, 2020 · 6 comments
Assignees

Comments

@bricoletc
Copy link
Collaborator

Right now, snakefmt allows the following to occur more than once:

  • include
  • ruleorder
  • localrules

snakemake allows quite a few more, including configfile, workdir, container, report.

(Actually I can see configfile multicopy should be supported, the config dictionary gets updated for every new file.)

Which keywords can be multicopy?
Might be worth updating the grammar to reflect this

@bricoletc
Copy link
Collaborator Author

configfile can now occur >1

@johanneskoester
Copy link
Contributor

For container and report, there is no need to occur more than once, except overwriting them in different included files.
Does your parser error out if that happens?

@bricoletc
Copy link
Collaborator Author

For current tip of master, anything other than in {"include", "ruleorder", "localrules", "configfile"} does indeed error out. Do you think all top-level duplicated keywords should not cause error?

@johanneskoester
Copy link
Contributor

Yes, sounds good to me. I don't think snakefmt should try to do the job of a linter or snakemake itself here. Just formatting.

@bricoletc
Copy link
Collaborator Author

Yet, in order to format properly, it needs a parser that's aware of the grammar. So its an easy bonus to validate the grammar. I think it could be valuable to formalise which keywords can occur twice. But for now i can just disable this !

@bricoletc
Copy link
Collaborator Author

From bb1543e parameter keywords in duplicate (eg configfile, include, input, output) do not cause parsing errors. It's fairly easy to roll that back in should it be needed.

rule named in duplicate do cause parsing errors, as does snakemake currently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants