Add rst inline-literal check to lint-docs task

Fail the docs lint task when single-backtick inline literals are used.

This is required because `pandoc` converts:

  `$playlist` -> <span class="title-ref">\$playlist</span>

Where this `span` element has no meaning in markdown context, and
`$playlist` loses its formatting. On the other hand, double backticks
are converted appropriately:

  ``$playlist`` -> `$playlist`
This commit is contained in:
Šarūnas Nejus 2026-02-08 01:52:23 +00:00
parent 1eb74aa740
commit e4314b700f
No known key found for this signature in database

View file

@ -238,7 +238,17 @@ cmd = "ruff check --config=pyproject.toml"
[tool.poe.tasks.lint-docs]
help = "Lint the documentation"
shell = "sphinx-lint --enable all --disable default-role $(git ls-files '*.rst')"
interpreter = "bash"
shell = """
set -o pipefail
files=$(git ls-files '*.rst')
grep -Eno ' `[^`][^`]+`[^_]' $files |
sed 's/ .*/ Use double backticks for inline literal (double-backticks-required)/' && failed=1
sphinx-lint --enable all --disable default-role $files || failed=1
exit ${failed:-0}
"""
[tool.poe.tasks.update-dependencies]
help = "Update dependencies to their latest versions."