Skip to content
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

Load YAML files safely #6897

Merged
merged 8 commits into from Apr 16, 2020
Merged

Load YAML files safely #6897

merged 8 commits into from Apr 16, 2020

Conversation

humitos
Copy link
Member

@humitos humitos commented Apr 13, 2020

Use a custom YAML loader to ignore all the unknown tags. This allow us to
support YAML files that have custom tags that are irrelevant for Read the Docs)
but are required for MkDocs to build the documentation properly.

Close: #6889

humitos added 2 commits Apr 13, 2020
Use a custom YAML loader to ignore all the unknown tags. This allow us to
support YAML files that have custom tags that are irrelevant for Read the Docs)
but are required for MkDocs to build the documentation properly.
@humitos humitos requested review from stsewd and Apr 13, 2020
@ericholscher
Copy link
Member

ericholscher commented Apr 13, 2020

Shouldn't this add a test that it actually ignores unknown tags?

@humitos
Copy link
Member Author

humitos commented Apr 14, 2020

@ericholscher
Copy link
Member

ericholscher commented Apr 14, 2020

I'm still not convinced this is a great UX for users. Their YAML files will now load but be missing data that they would expect to be in it. I understand the use-case for parsing a users mkdocs.yml, but we shouldn't ever support this for our own config file, right?

@humitos
Copy link
Member Author

humitos commented Apr 14, 2020

That's true. The correct approach would be to ignore these tags when reading the mkdocs.yml but keep using the regular yaml.safe_load for our own .readthedocs.yaml file.

Copy link
Member

@ericholscher ericholscher left a comment

👍 with passing tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants