Conversation
|
Thanks for your contribution! But probably it will be sufficient to add sphinx-lint to CI (#1786)? |
I like both solutions. The important bit is the ability to invoke it locally. @rffontenelle WDYT? Should we go for the other PR? |
|
I'm fine with it. Although I wonder if it uses problem-matcher annotations and if not if it would feasible. Personally I find annotations very handy on GitHub Actions run log |
|
@rffontenelle @webknjaz I was clearing out the approved-but-not-merged PRs, and noticed this one was still lingering, but now with conflicts. Should we just close it, or is it worth resurrecting? |
for more information, see https://pre-commit.ci
Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
71d1dd6 to
3306e5b
Compare
webknjaz
left a comment
There was a problem hiding this comment.
@ncoghlan I seem to recall a similar/related PR by @hugovk but don't remember the context anymore. We should merge this provided https://docs.zizmor.sh/audits/#template-injection is addressed.
| - name: Lint translation file | ||
| if: always() | ||
| run: sphinx-lint locales/${LANGUAGE}/LC_MESSAGES/messages.po | ||
| run: nox -s sphinx_lint -- locales/${{ matrix.language }}/LC_MESSAGES/messages.po |
There was a problem hiding this comment.
This should be rendered on the bash layer to avoid the template injection problems:
| run: nox -s sphinx_lint -- locales/${{ matrix.language }}/LC_MESSAGES/messages.po | |
| run: nox -s sphinx_lint -- locales/${LANGUAGE}/LC_MESSAGES/messages.po |
See #1166
This runs sphinx-lint in the docs together with HTML build and linkcheck. It accepts one or more path as positional argument, so e.g. one may specify the path of a translation file instead of using the source reST files from "source" directory.
I was going to add sphinx-lint package to requirements.txt and pip-install from that file, but this unnecessarily added dependencies and increased install time.
Running without posargs:
Running with a posargs as the filepath "messages.po", the Brazilian Portuguese translation obtained from
translation/sourcebranch:📚 Documentation preview 📚: https://python-packaging-user-guide--1800.org.readthedocs.build/en/1800/