Hey there,
Huge thanks to you all for getting the language server working properly in the VSCode extension.
One recurring issue is that the linter thinks a process variable is not used, when it is used in a template.
I like to make my python template scripts reusable, so I use a pattern of injecting arguments into template like this as command line arguments, e.g. templates/foo.py
#!/usr/bin/env python
from argparse import ArgumentParser
import shlex
def get_parser() -> ArgumentParser:
...
argv = sys.argv
if len(sys.argv) == 1:
# is being called directly from nextflow, use argv from parsing argstr
argv = shlex.split("${argstr}")
args = get_parser().parse_args(argv)
...
Hey there, Huge thanks to you all for getting the language server working properly in the VSCode extension.
One recurring issue is that the linter thinks a process variable is not used, when it is used in a template.
I like to make my python template scripts reusable, so I use a pattern of injecting arguments into template like this as command line arguments, e.g.
templates/foo.py
In this example, the linter has a problem with
argstr
, "Variable was declared but not used", despite it being used in the template.I can think of three ways around this:
//noqa
(sounds feasible, could be broadly applicable to other issues)script:
andtemplate
(easy but blunt hack)Thanks