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

Fix make lint-readme (RST link errors) #525

Merged
merged 8 commits into from Aug 2, 2016

Conversation

Projects
None yet
2 participants
@peterjc
Copy link
Contributor

peterjc commented Jul 26, 2016

Partly (update - fully) addresses #524, remaining issues:

$ make lint-readme
if [ -f .venv/bin/activate ]; then . .venv/bin/activate; fi; python setup.py check -r -s
running check
warning: check: Duplicate implicit target name: "conda".

warning: check: Duplicate implicit target name: "docker".

warning: check: Duplicate explicit target name: "cwl".

error: Please correct your package.
make: *** [lint-readme] Error 1

I think the cwl problem is that the link exists in both README.rst and HISTORY.rst and the two files get combined within setup.py which create the duplicate:

long_description=readme + '\n\n' + history,

peterjc added some commits Jul 26, 2016

Sort and depulicate links in HISTORY.rst
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...
Include repo_id fix in 0.22.0 release notes
Fixes unused hyperlink target warning via rst-lint tool
from https://pypi.python.org/pypi/restructuredtext_lint
Fix duplicated link target & unused link in RST
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.
Fix implicit link target duplication in README.rst
Spotted via https://pypi.python.org/pypi/restructuredtext_lint
since rst-lint README.rst gives much more helpful messages than
make lint-readme

@peterjc peterjc changed the title Fix some of the RST duplicate link errors from linting Fix make lint-readme (RST link errors) Jul 26, 2016

@peterjc

This comment has been minimized.

Copy link
Contributor Author

peterjc commented Jul 26, 2016

This now passes make lint-readme - the separate command line tool from https://pypi.python.org/pypi/restructuredtext_lint was very useful here - note it flags some more issues:

$ rst-lint *.rst
INFO File CODE_OF_CONDUCT.rst is clean.
INFO CONTRIBUTING.rst:186 Duplicate implicit target name: "tox".
INFO HISTORY.rst:773 Hyperlink target "2052db0" is not referenced.
INFO HISTORY.rst:783 Hyperlink target "30a9c3f" is not referenced.
INFO HISTORY.rst:784 Hyperlink target "32c6e7f" is not referenced.
INFO HISTORY.rst:788 Hyperlink target "3499ca0" is not referenced.
INFO HISTORY.rst:810 Hyperlink target "552059f" is not referenced.
INFO HISTORY.rst:829 Hyperlink target "776773c" is not referenced.
INFO HISTORY.rst:883 Hyperlink target "issue 186" is not referenced.
INFO HISTORY.rst:888 Hyperlink target "issue 206" is not referenced.
INFO HISTORY.rst:903 Hyperlink target "issue 333" is not referenced.
INFO File README.rst is clean.

The unused link targets in HISTORY.rst suggest potentially missing entries in the change log?

Regarding the tox target name in CONTRIBUTING.rst, I don't quite understand the RST rules for section names as implicit target names.

@jmchilton

This comment has been minimized.

Copy link
Member

jmchilton commented Aug 2, 2016

Completely missed this PR - sorry. Thanks for the fix!

@jmchilton jmchilton merged commit 22f40a4 into galaxyproject:master Aug 2, 2016

1 check failed

continuous-integration/travis-ci/pr The Travis CI build failed
Details

@peterjc peterjc deleted the peterjc:history_links branch Aug 2, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment