-
-
Notifications
You must be signed in to change notification settings - Fork 230
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
Protect ruamel from blank comment strings when making templates #1390
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1390 +/- ##
=======================================
Coverage 65.93% 65.93%
=======================================
Files 93 93
Lines 16447 16447
Branches 4358 4358
=======================================
Hits 10844 10844
+ Misses 4451 4445 -6
- Partials 1152 1158 +6
Continue to review full report at Codecov.
|
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.
Thank you @leipzig ! Can you add a confirmatory test-case?
OK I don't see any existing tests of |
Yeah, I'm setting you up to test previously under-tested code; good luck and please ask for help! https://codecov.io/gh/common-workflow-language/cwltool/src/main/cwltool/main.py#L160 |
14243b0
to
786a0ee
Compare
If ruamel.yaml encounters a blank comment string "" instead of None it throws a fit. This happens when an input is of type 'Record' without a name ``` read_names: type: - type: record ``` ``` Traceback (most recent call last): File "~/dev/capanno-utils/lib/python3.6/site-packages/cwltool/main.py", line 972, in main make_template(tool) File "~/dev/capanno-utils/lib/python3.6/site-packages/cwltool/main.py", line 732, in make_template generate_input_template(tool), File "~/dev/capanno-utils/lib/python3.6/site-packages/cwltool/main.py", line 299, in generate_input_template template.insert(0, name, value, comment) File "~/dev/capanno-utils/lib/python3.6/site-packages/ruamel/yaml/comments.py", line 722, in insert self.yaml_add_eol_comment(comment, key=key) File "~/dev/capanno-utils/lib/python3.6/site-packages/ruamel/yaml/comments.py", line 294, in yaml_add_eol_comment if comment[0] != '#': ```
This pull request fixes 2 alerts when merging 62bf024 into 8c4665d - view on LGTM.com fixed alerts:
|
Thanks @leipzig ! |
If Ruamel encounters a blank comment string "" instead of None it throws a hissy fit. This happened for me when an input was of type 'Record' using
--make-template