This repository has been archived by the owner on Feb 2, 2023. It is now read-only.
Ensure values are str
types when converting from YAML to Markdown
#12
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🗣 Description
This pull request updates portions of the
yml2md
command so that any values where we check thelen()
is checked for truthiness and converted withstr()
first. It also converts a piece of error handling from manually printing tostderr
to instead use thelogging
library appropriately.💭 Motivation and context
When a person who is unfamiliar with YAML is updating an entry they may see no problem with the following:
However, the second value will be read as a
float
value instead of as astr
value. This will cause theyml2md
command to fail with aTypeError
when processing this entry.🧪 Testing
Automated tests pass. When run with the sample version data above the
v1.1.1
branch fails with aTypeError
as expected. When used with this branch the conversion completes with no issues.✅ Pre-approval checklist