Add check for dangling hyphens #56
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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?