-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add sphinx-lint session to noxfile #1800
base: main
Are you sure you want to change the base?
Conversation
for more information, see https://pre-commit.ci
Thanks for your contribution! But probably it will be sufficient to add sphinx-lint to CI (#1786)? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
accepting another path as positional argument. | ||
""" | ||
session.install("sphinx-lint==1.0.0") | ||
target = session.posargs if len(session.posargs) >= 1 else ["source"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: this would probably be more elegant
target = session.posargs if len(session.posargs) >= 1 else ["source"] | |
target = session.posargs or ["source"] |
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 |
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/source
branch:📚 Documentation preview 📚: https://python-packaging-user-guide--1800.org.readthedocs.build/en/1800/