Integrate Tool Parameter Modeling into Linting (for Planemo)#19073
Integrate Tool Parameter Modeling into Linting (for Planemo)#19073jdavcs merged 1 commit intogalaxyproject:devfrom
Conversation
bernt-matthias
left a comment
There was a problem hiding this comment.
Super cool. Haven't had time yet to have a more detailed look.
| except Exception as e: | ||
| error_str = _cleanup_pydantic_error(e) | ||
| lint_ctx.warn( | ||
| f"Test {test_idx}: failed to validate assertions. Validation errors are [{error_str}]" |
There was a problem hiding this comment.
When I rewrote the linter stuff my idea was that each linter class can emit only one message, i.e. there should be only one call to lint_ctx.... per class.
Then we can easily enable / disable specific messages. Downside is that the code gets a bit awkward in a few places. Still, maybe we should stick to that scheme?
There was a problem hiding this comment.
The existing class TestsExpectNumOutputs outputs one message per test index. This does the same thing. Is that the problem or is the problem the warning on the parse error - because I return after that and so it should only output one message for the tool.
2a7f6c8 to
5b08e9b
Compare
Builds on #19027 - only the last commit is adding functionality beyond that.
Adds two new linters so far. One runs the test case validation added in #18679. So basically it indicates if the tool test case are already passing the best practices required for profile 24.2 tools - allowing disambiguation and stronger typing. The other linter builds assertion models for the outputs and runs them against the Pydantic validators added in #18787. There is a test case added the shows this provides checks beyond the XSD.
The way I originally defined the linting levels - errors would prevent the tool from loading. The test linting added since then by others have recorded a bunch of test case issues as errors instead of warnings - I stuck by my original classification but maybe the assertion problems should be errors the way things have drifted?
The pydantic errors are an unfortunate combination of much wordier and less precise than the existing linters (all the context is stripped out - what output, what line number, etc...) so I'm contemplating hiding some of the output behind a verbose flag.
How to test the changes?
(Select all options that apply)
License