File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11""" Click definitions for various shared options and arguments.
22"""
3+
4+ import os
5+
36import click
47from galaxy .tools .deps import docker_util
58
@@ -142,6 +145,13 @@ def required_tool_arg():
142145 return click .argument ('path' , metavar = "TOOL_PATH" , type = arg_type )
143146
144147
148+ def _optional_tools_default (ctx , param , value ):
149+ if param .name == "paths" and len (value ) == 0 :
150+ return [os .path .abspath (os .getcwd ())]
151+ else :
152+ return value
153+
154+
145155def optional_tools_arg (multiple = False ):
146156 """ Decorate click method as optionally taking in the path to a tool
147157 or directory of tools. If no such argument is given the current working
@@ -159,9 +169,9 @@ def optional_tools_arg(multiple=False):
159169 return click .argument (
160170 name ,
161171 metavar = "TOOL_PATH" ,
162- default = "." ,
163172 type = arg_type ,
164173 nargs = nargs ,
174+ callback = _optional_tools_default ,
165175 )
166176
167177
Original file line number Diff line number Diff line change 44 cat $input1 #for $q in $queries# ${q.input2} #end for# > $out_file1
55 </command >
66 <inputs >
7- <param name =" input1" type =" data" label =" Concatenate Dataset" />
7+ <param name =" input1" type =" data" label =" Concatenate Dataset" format = " data " />
88 <repeat name =" queries" title =" Dataset" >
9- <param name =" input2" type =" data" label =" Select" />
9+ <param name =" input2" type =" data" label =" Select" format = " data " />
1010 </repeat >
1111 </inputs >
1212 <outputs >
13- <data name =" out_file1" format = " input " metadata_source =" input1" />
13+ <data name =" out_file1" format_source = " input1 " metadata_source =" input1" />
1414 </outputs >
1515 <tests >
1616 <test >
1919 </test >
2020 </tests >
2121 <help >
22+ Concatenate datasets.
2223 </help >
2324</tool >
Original file line number Diff line number Diff line change @@ -22,6 +22,12 @@ def test_fail_tools(self):
2222 lint_cmd = ["lint" , fail_tool ]
2323 self ._check_exit_code (lint_cmd , exit_code = 1 )
2424
25+ def test_lint_default (self ):
26+ with self ._isolate_repo ("single_tool" ):
27+ self ._check_exit_code (["lint" , "--skip" , "citations" ])
28+ with self ._isolate_repo ("single_tool" ):
29+ self ._check_exit_code (["lint" ], exit_code = 1 )
30+
2531 def test_lint_multiple (self ):
2632 names = ["fail_citation.xml" , "fail_order.xml" ]
2733 paths = list (map (lambda p : os .path .join (TEST_TOOLS_DIR , p ), names ))
You can’t perform that action at this time.
0 commit comments