Skip to content

Commit aad1eed

Browse files
committed
Update linting for parameters that define arguments and not names.
With test case. Closes #245.
1 parent 7835fad commit aad1eed

File tree

2 files changed

+32
-2
lines changed

2 files changed

+32
-2
lines changed

planemo_ext/galaxy/tools/linters/inputs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ def lint_inputs(tool_xml, lint_ctx):
1010
if "type" not in param_attrib:
1111
lint_ctx.error("Found param input with no type specified.")
1212
has_errors = True
13-
if "name" not in param_attrib:
13+
if "name" not in param_attrib and "argument" not in param_attrib:
1414
lint_ctx.error("Found param input with no name specified.")
1515
has_errors = True
1616

1717
if has_errors:
1818
continue
1919

2020
param_type = param_attrib["type"]
21-
param_name = param_attrib["name"]
21+
param_name = param_attrib.get("name", param_attrib.get("argument"))
2222
if param_type == "data":
2323
if "format" not in param_attrib:
2424
lint_ctx.warn("Param input [%s] with no format specified - 'data' format will be assumed.", param_name)
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<tool id="copy" name="Copy Dataset" version="1.0">
2+
<description>copies a dataset</description>
3+
<command>
4+
cp $input $output
5+
</command>
6+
<inputs>
7+
<param name="input1" type="data" format="txt" label="Concatenate Dataset"/>
8+
<param argument="-r" type="data" format="txt" label="Recursive?"/>
9+
</inputs>
10+
<outputs>
11+
<data name="output" format="txt"/>
12+
</outputs>
13+
<tests>
14+
<test expect_failure="true" expect_exit_code="1">
15+
<param name="input1" value="1.bed"/>
16+
<assert_stdout>
17+
<has_line line="Indexed 0 sequences" />
18+
</assert_stdout>
19+
<assert_stderr>
20+
<has_line line="Identifier 'gi|16127999|ref|NP_414546.1|' not found in sequence file" />
21+
</assert_stderr>
22+
</test>
23+
</tests>
24+
<help>
25+
Some Awesome Help!
26+
</help>
27+
<citations>
28+
<citation type="doi">10.1101/014043</citation>
29+
</citations>
30+
</tool>

0 commit comments

Comments
 (0)