-
-
Notifications
You must be signed in to change notification settings - Fork 17
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 check for dangling hyphens #56
Conversation
Thanks! Perhaps the sympy ones could be considered true positives; it's not grammatical to use a hyphen there. Alternatively, perhaps we could exclude lines right before a blank line from the check. |
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Yeah, I'd prefer a colon there too. |
Thanks a lot of this PR! Let's fix friend projects and merge it! (Better not merge it before, it could break their CI if they did not pinned the sphinx-lint version). |
Thanks for fixing the friend projects! This CI is now passing: https://github.com/hugovk/sphinx-lint/actions/runs/4393071119 |
Thanks for this PR! |
Fixes #54.
The failures are caused by finding IRL trailing hyphens in friend projects: pandas, cpython, peps, sympy.
Some false positives in there, such as:
Both are inside
.. doctest::
blocks:https://github.com/python/cpython/blob/a35fd38b57d3eb05074ca36f3d57e1993c44ddc9/Doc/library/decimal.rst?plain=1#L295
https://github.com/python/cpython/blob/a35fd38b57d3eb05074ca36f3d57e1993c44ddc9/Doc/library/decimal.rst?plain=1#L327
We're using
rst_only=True
in the check to skip things like code blocks, but we're detectingdoctest
blocks as non-code. So let's fix that too.Also, on macOS, I get failures like this, due to the annoying habit of macOS to create
.DS_Store
files, so let's skip them:That leaves:
These are valid, except these use hyphens like colons:
https://github.com/sympy/sympy/blob/5d2556f1546b1fe64e175fa808f495a58c3ac998/doc/src/modules/vector/coordsys.rst?plain=1#L119
https://github.com/sympy/sympy/blob/5d2556f1546b1fe64e175fa808f495a58c3ac998/doc/src/modules/vector/coordsys.rst?plain=1#L217
How should we deal with the failing "friend" tests?