Avoid ambigous destination value in test case...#186
Avoid ambigous destination value in test case...#186jmchilton merged 2 commits intogalaxyproject:masterfrom
Conversation
The include source of "../shared_files/extra_test_data/**" would only find "../shared_files/extra_test_data/extra_test_file.txt" which after strip_components 3 gives "extra_test_file.txt" Question: did the ".shed.yml" destination mean call this file "test-data" [sic] or use "test-data/extra_test_file.txt" instead? What if the include source glob matches multiple files? Then might expect destination must be a folder? Using destination "test-data/" seem unambiguous.
|
P.S. I am willing to try and add code to catch the proposed error condition. |
|
Okay - I can live with that - what you are proposing seems like a tighter, more reasonable spec. We should make sure shed_lint provides a good description of the problem though. |
|
So changes to both |
|
If you return an exception - like unmatched globs - I think Update: This line https://github.com/galaxyproject/planemo/blob/master/planemo/shed/__init__.py#L775 is what I was referring to about "returning" an exception. I can definitely work on that part - the concept of "missing" needs to be generalized to other sorts of validation exceptions. But as long as we get them out of that chunk of code as exceptions shed lint should handle it. |
Avoid ambigous destination value in test case...
|
Awesome - thanks for working on this. |
Suggestion: If the
sourcehas any wildcards (or is a folder with an implicit wildcard), thendestinationmust be a directory given with trailing slash (otherwise error).The include source of "../shared_files/extra_test_data/**" would only find "../shared_files/extra_test_data/extra_test_file.txt" which after strip_components 3 gives "extra_test_file.txt"
Question: did the ".shed.yml" destination of "test-data" mean call this file "test-data" [sic] or use "test-data/extra_test_file.txt" instead? Why?
What if the include source glob matches multiple files? Then might expect destination must be a folder - since alternative means trying to map multiple input files to one in the tar-ball/
Using destination "test-data/" seem unambiguous and preferable.
(I found this issue during re-factoring while working on #180)