Skip to content

When should we write separate scripts and when should we use configfiles #49

@mvdbeek

Description

@mvdbeek

That discussion came up in galaxyproject/tools-iuc#1535.

Sometimes we need a helper script.
This can either be a script next to the tool xml, or we can template out a script
using the <configfile> mechanism.
We do have examples for both, but no clear consensus on when to use which mechanism.

The arguments for a script as separate file on disk are:

  • you need to mentally "parse" the galaxy variables and cheetah stuff from the script
  • you can't test your script independently from the galaxy tool
  • you can't step in with a debugger
  • you can't have code-highlighting / linting etc.
  • Putting a script in a makes it impossible to run static checks/linting on it or to run something like 2to3
  • may require extra escape mechanisms as code could be directly injected var <- "{$var}" then $var may not include quotes etc.

The arguments against (for including it as <configfile> in the tool wrapper) it are:

  • we need to write a separate argument parser for the script that duplicates information
  • can be used as workaround if command length exceeds the shells maximum length

(Feel free to edit/add arguments)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions