timothycrosley / portray

Your Project with Great Documentation.
MIT License
861 stars 74 forks source link

Ensure '', false, and False are accepted for include_reference_documentation #100

Closed robbintt closed 1 year ago

robbintt commented 1 year ago

The config parameter include_reference_documentation is somehow rendered to a string when set in PyProject.toml, and the falsey check doesn't work. This change checks the string values "", "false", and "False" to correctly enable this feature.

The second change ensures that in the case of empty string, include_reference_documentation="", there is no KeyError during cleanup.

I've retained the original truthy evaluation in case there is some code path that uses it, for example, if it gets it directly from the default config Python file.

robbintt commented 1 year ago

Alternative to this PR is to correctly render the type as True or False.