fix: Load Sphinx inventories whose dispname spans multiple lines by Yoshanuikabundi · Pull Request #748 · mkdocstrings/mkdocstrings

Yoshanuikabundi

@Yoshanuikabundi @pawamoy

Ruff 0.10.0 introduces the S704 lint, which triggers when a non-
literal string is passed to `markupsafe.Markup()`. This triggered
5 times in the codebase. Only one of these errors was trivially
fixable, and the fix caused tests to fail because the "fix"
introduced escapes to already correct markup. This commit therefore
configures Ruff to ignore this lint and does not fix any code that
triggers it.

Other changes are due to other formatting and linting changes from
recent releases of Ruff.

Ruff 0.10.0: https://github.com/astral-sh/ruff/releases/tag/0.10.0
Lint S704: https://docs.astral.sh/ruff/rules/unsafe-markup-use/

@Yoshanuikabundi @pawamoy

Previously, inventory items whose `dispname` value contains multiple lines would prevent mkdocstrings from loading the whole inventory file. This change makes mkdocstrings ignore invalid lines in inventories so that the rest of the inventory can still be loaded.

This continuation line behavior can be seen in the wild in the OpenEye toolkits inventory file and a few Open Force Field inventory files. These projects' inventories cannot be used with mkdocstrings because of the raised error.

Note that in Sphinx too, these inventory files are read succesfully, and the continuation lines are discarded, truncating the display name. In theory, a continuation line that by chance did parse correctly would be interpreted by both packages as a new inventory item.

OpenEye Toolkits inventory file: https://docs.eyesopen.com/toolkits/python/objects.inv
Open Force Field Toolkit inventory file:  https://docs.openforcefield.org/projects/toolkit/en/stable/objects.inv
BespokeFit inventory file: https://docs.openforcefield.org/projects/bespokefit/en/stable/objects.inv