mirror of
https://github.com/beetbox/beets.git
synced 2026-02-16 12:24:53 +01:00
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:
parent
1eb74aa740
commit
e4314b700f
1 changed files with 11 additions and 1 deletions
|
|
@ -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."
|
||||
|
|
|
|||
Loading…
Reference in a new issue