Enable show subverb to print yamllint compliant YAML. - #58
Conversation
Signed-off-by: Leander Stephen D'Souza <leanderdsouza1234@gmail.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #58 +/- ##
==========================================
+ Coverage 15.30% 15.32% +0.02%
==========================================
Files 11 11
Lines 562 561 -1
Branches 94 91 -3
==========================================
Hits 86 86
+ Misses 474 473 -1
Partials 2 2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
knmcguire
left a comment
There was a problem hiding this comment.
Tested it and I get this as well:
> colcon mixin show test
---
test:
coverage-pytest:
pytest-args:
- --cov-report=term
pytest-with-coverage: true
linters-only:
ctest-args:
- -L
- linter
pytest-args:
- -m
- linter
linters-skip:
ctest-args:
- -LE
- linter
pytest-args:
- -m
- not linter
memcheck:
ctest-args:
- -D
- ExperimentalMemCheck
An added benefit is that if there are any mixins with malformed yaml formats, it will fail here, which I'm not sure it would have failed with colcon mixin before. Perhaps an good thing to add in another PR to the other functions than show (not part of this PR)
KmoM88
left a comment
There was a problem hiding this comment.
I'm getting the same results testing with the colcon-mixin-repository example
$ colcon mixin show test [9:55:31]
---
test:
coverage-pytest:
pytest-args:
- --cov-report=term
pytest-with-coverage: true
linters-only:
ctest-args:
- -L
- linter
pytest-args:
- -m
- linter
linters-skip:
ctest-args:
- -LE
- linter
pytest-args:
- -m
- not linter
memcheck:
ctest-args:
- -D
- ExperimentalMemCheck
Also tested that with this feature it produces a valid yamllint while the previous version fails that validation.
Basic Info
Description of contribution in a few bullet points
colcon mixin showto print in a YAML that is compliant with the onboardyamllintlinter.IndentDumperso thatyaml.dumpwould print indentation that is suited to the linter.Description of how this change was tested
Add the mixins from the sample colcon-mixin-repository:
Without this change, the
showsubverb would yield the following:colcon mixin show testThis is printed in a non-standard format, and is not a YAML file.
After incorporating this PR, the output is as follows:
You can verify the sanctity of this output by testing it against
yamllint: