Fix make lint-readme (RST link errors)#525
Merged
jmchilton merged 8 commits intogalaxyproject:masterfrom Aug 2, 2016
Merged
Conversation
Used this quick Python script with manual whitespace
cleanup.
import sys
def link_de_dup(filename):
links = []
text = []
for line in open(filename):
if line.startswith(".. _"):
links.append(line)
else:
text.append(line)
with open(filename, "w") as handle:
for line in text:
handle.write(line)
for line in sorted(set(links)):
handle.write(line)
for filename in sys.argv[1:]:
print("Processing %s" % filename)
link_de_dup(filename)
Could be more clever about sorting the issue and pull request
links numerically rather than alphabetically...
Spotted using command line too rst-lint from https://pypi.python.org/pypi/restructuredtext_lint
Fixes unused hyperlink target warning via rst-lint tool from https://pypi.python.org/pypi/restructuredtext_lint
Fixes unused hyperlink target warning via rst-lint tool from https://pypi.python.org/pypi/restructuredtext_lint about ``Common Workfow Language`` by using this rather than ``CWL``. This allows us to remove the ``CWL`` link target, and thus avoid that being a duplicate link in setup.py when the ``README.rst`` and ``HISTORY.rst`` files are combined. That solves one of the complaints from ``make lint-readme``. Fixes unused hyperlink target warning via rst-lint tool from https://pypi.python.org/pypi/restructuredtext_lint about by using this rather than . This allows us to remove the link target, and thus avoid that being a duplicate link in setup.py when the and files are combined. That solves one of the complains from if [ -f .venv/bin/activate ]; then . .venv/bin/activate; fi; python setup.py check -r -s running check.
Spotted using rst-lint README.rst from https://pypi.python.org/pypi/restructuredtext_lint
Spotted via https://pypi.python.org/pypi/restructuredtext_lint since rst-lint README.rst gives much more helpful messages than make lint-readme
Contributor
Author
|
This now passes The unused link targets in Regarding the |
Member
|
Completely missed this PR - sorry. Thanks for the fix! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Partly (update - fully) addresses #524, remaining issues:
I think the
cwlproblem is that the link exists in bothREADME.rstandHISTORY.rstand the two files get combined withinsetup.pywhich create the duplicate: