-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide more context for lint context #12978
Provide more context for lint context #12978
Conversation
f638f00
to
f03b3b2
Compare
9326829
to
e6c5ff6
Compare
Hah, this looks fancy:
|
e6c5ff6
to
fa55cf8
Compare
Awesome! |
Line and xpath reported seem to be useful out of the box:
Here is a test tool + macro and the planemo output: test.xml 1 <tool id="test" name="test" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="20.01" license="MIT">
2 <description>test</description>
3 <macros>
4 <token name="@TOOL_VERSION@">0.1.0</token>
5 <token name="@VERSION_SUFFIX@">0</token>
6 <import>macros.xml</import>
7 </macros>
8 <xrefs>
9 <xref type="bio.tools"></xref>
10 </xrefs>
11 <requirements>
12 <requirement type="package" version="@TOOL_VERSION@">test</requirement>
13 </requirements>
14 <command detect_errors="exit_code"><![CDATA[
15 ## TODO: Fill itestn command using Cheetah templates
16 ## Hint: Use [ctrl+alt+c] after defining the inputs/outputs to auto-generate some Cheetah boilerplate code for you.
17 ]]></command>
18 <inputs>
19 <expand macro="matrix_scooler_macro"/>
20 <param type="select" name="test"/>
21 </inputs>
22 <outputs>
23 </outputs>
24 <tests>
25 <!-- Hint: You can use [ctrl+alt+t] after defining the inputs/outputs to auto-scaffold some basic test cases. -->
26 </tests>
27 </tool> macros.xml 1 <macros>
2 <xml name='matrix_scooler_macro'>
3 <param name='1matrix_scooler' type="data" format="txt"
4 label="Matrix to compute on"/>
5 </xml>
6 </macros>
|
Nice! we can definitely work with that! Only some things I found confusing:
|
cool
Maybe lxml takes the line where the tag was closed? One can argue about the xpath (but here I guess lxml already expanded and therefore the I guess in most cases we have to live with the numbers and paths provided by lxml. For the others: Seems that I posted outdated output:
|
3f8554d
to
aea2d3e
Compare
line number and xpath
ie include only the tested features
- more specific error message for whitespace in pre/suffix in tool version and name - do not pront valid tool id message if whitespaces are found
and several small improvements - lint for empty param name / type - distinct option definition possibilities for selects and selects in conditionals - condtional parameter - check for exactly 1 conditional param (before only 0) - warn if boolean select param for conditional - warn for optional and multiple select
- and add warning if no valid citation is found
- info->warn for deprecated interpreter attribute - add error for empty command text - fix check for TODO in command
- fix warning for invalid cheetah placeholder
efc8d52
to
48abc4a
Compare
Thanks for merging :) But it was not actually finished yet. I just removed the wip label before the committers meeting in order to get it into the discussion and forgot to readd it. I will add a follow up PR today or tomorrow. |
@davelopez I did some experiments and have two questions:
|
Nice, I think we can work with that. I don't know if it is too common to have multiple macro files but probably there is some guesswork we can do at the language server level. For this, I will have to do some experiments too :)
Yeah, we can show the expanded version of the document for troubleshooting the linting errors and that will be helpful to point to the correct line in case the |
Not super common, but it exists. @annefou love multiple ones I think :) |
Yep I do. I am probably not a good example in terms of best practices... |
You have complicated tools and it makes sense in those cases I think. Circos is another example: https://github.com/galaxyproject/tools-iuc/tree/master/tools/circos |
Good news, seems that Just adding this. |
Continue here #13186 |
The tool linter currently "only" provides a message. It might be cool if the output would allow more easily to find the problem. Here I try to add the source line / xpath to the linter messages.
This would be particularly helpful if integrated in 3rd party software like the GLS: galaxyproject/galaxy-language-server#180
TODO:
lint_tool_source
function to return the lint context(s)#include
workslint_general
gets tool_source and determines requirements not via xml foo, so extended output is not yet possibleHow to test the changes?
(Select all options that apply)
License