Increase worflow linting#1463
Conversation
|
I don't know how to fix: |
|
I implemented new linting for the |
|
Also I am wondering how many tests I should generate following these changes? |
bernt-matthias
left a comment
There was a problem hiding this comment.
Cool. I think adding a test for the --iwc flag would be good.
|
Hi,
Importantly, the check for a testParameterFiles in .dockstore has been moved to dockstore_best_practices so in a regular run will not raise a warning anymore. |
|
You can run black to fix the linting errors |
|
And |
|
@mvdbeek can you help me with the last test. How to assert that the command raise an InputError? and that the exception message contains a given string? Should I test on |
|
I'm seeing: I would think that probably means we're not correctly handing a default argument in the skip linters case ? |
|
Yes I wanted to tell @bernt-matthias about this. This is a message I get each time I run planemo workflow_lint but surprisingly it still gives a exit code of 0: |
|
And even without skip, the message is very confusing for users: But I don't know if this should be solved in this PR or in another PR. |
|
That's a different from the one in the test though. diff --git a/planemo/lint.py b/planemo/lint.py
index 5b85022de4..c5964428aa 100644
--- a/planemo/lint.py
+++ b/planemo/lint.py
@@ -23,7 +23,7 @@ def build_lint_args(ctx, **kwds):
skip = ctx.global_config.get("lint_skip", "")
if isinstance(skip, list):
skip = ",".join(skip)
- skip_types = [s.strip() for s in skip.split(",")]
+ skip_types = [s.strip() for s in skip.split(",") if s.strip()]
for skip_file in kwds.get("skip_file", []):
with open(skip_file) as f:fixes the odd test output. |
|
Because this would require a big rearrangement I think and it is more difficult to review. |
I can integrate this. |
Fixed in #1453 |
|
This: |
|
The only test failing seems unrelated to this PR. |
planemo/workflow_lint.py
Outdated
|
|
||
| def build_wf_lint_args(ctx, **kwds): | ||
| lint_args = build_lint_args(ctx, **kwds) | ||
| lint_args["iwc_grade"] = str(kwds.get("iwc", False)) |
There was a problem hiding this comment.
| lint_args["iwc_grade"] = str(kwds.get("iwc", False)) | |
| lint_args["iwc_grade"] = kwds.get("iwc", False) |
We should just leave this a boolean.
There was a problem hiding this comment.
If I keep it as boolean then I get a type violation as lint_args is supposed to be a dict of str -> str
There was a problem hiding this comment.
See
planemo/planemo/workflow_lint.py
Line 125 in b9e62ef
There was a problem hiding this comment.
Or I change it to : lint_args: Dict[str, Union[str, List[str], bool]] ?
There was a problem hiding this comment.
Dict[str, Any] is probably enough, I'll push a commit to your branch.
There was a problem hiding this comment.
Thanks, if not I can commit it.
Co-authored-by: M Bernt <m.bernt@ufz.de>
mvdbeek
left a comment
There was a problem hiding this comment.
This is excellent, thanks everyone!
I am not sure it is the good way to do it.
For the moment, I cannot make it like for the tools with classes, in order to make it customizable but I think I put everything I thought was missing in the current workflow_lint.
I used sometimes
'and sometimes". Is this an issue?