I’m using VSCode to codify my Nextflow pipelines and with the last updates I started getting some linting. Good!
Now I’m wondering about the meaning of some of the messages, but I will start with some comments and opinions.
It complained me about the ordering of the labels of a sub-workflow. I defined them like in a process: inputs, outputs and script (take, emit, main), but it looks like the linter do not like it and wants a different sorting: inputs, script, outputs. Besides the fact that I don’t like it that way (I prefer to have the workflow signature in a single location, like with any method where you have the function name, the inputs and the output type in the same line), it is not consistent with the ordering of the processes, where the input-output-script schema is kept.
Another thing that I don’t like is that it complains about the variable names defined in a map that are not used, and tells me to prepend an underscore to avoid the warning. This again goes against the style of the script where other variables have their name without additions. And having to add and remove the underscore when you start to use that variable seems to be tedious.
And finally, my doubts.
I’m getting a few Groovy-style type annotations are ignored
in a method definition written in Java:
def process_file(bgzip_file) {
File bgz_file = new File("$bgzip_file");
long bgz_fileSizeInBytes = bgz_file.length();
.
.
.
The method works perfectly and the variable types are well defined. But the complain is about the File
and long
qualifiers. What should I do? What the linter is expecting? I cannot see any issue with the current code, and I foresee compilation errors if I don’t declare those variables :-?
Another thing that scares me is a warning in the nextflow.config: Unexpected input: 'def'
.
I’m defining a method to check and limit the resources requested by the different processes. I think this is a method widely used, but it looks like it is “unexpected”:
def check_max(obj, type) {
.
.
.
Any clue about what to do with this warning?