-
Notifications
You must be signed in to change notification settings - Fork 85
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
Increase worflow linting #1463
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? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
@@ -59,6 +60,12 @@ class WorkflowLintContext(LintContext): | |||
training_topic = None | |||
|
|||
|
|||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See
planemo/planemo/workflow_lint.py
Line 125 in b9e62ef
ctx: "PlanemoCliContext", paths: Iterable[str], lint_args: Dict[str, Union[str, List[str]]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or I change it to : lint_args: Dict[str, Union[str, List[str], bool]]
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dict[str, Any]
is probably enough, I'll push a commit to your branch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, if not I can commit it.
Co-authored-by: M Bernt <m.bernt@ufz.de>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?