Skip to content
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

doc8 emits false positives for link targets defined in rst_prolog #125

Open
Julian opened this issue Dec 21, 2022 · 0 comments
Open

doc8 emits false positives for link targets defined in rst_prolog #125

Julian opened this issue Dec 21, 2022 · 0 comments

Comments

@Julian
Copy link

Julian commented Dec 21, 2022

Given a conf.py containing:

project = "foo"
copyright = "2022, Julian Berman"
author = "Julian Berman"

rst_prolog = """
.. _example: https://example.com
"""

with an example link defined in the rst_prolog, and a simple index.rst using the target:

Foo
===

This is an `example`_.

doc8 emits:

~/Desktop/foo/docs is a git repository on main 
⊙  doc8 .                                                                                                                         julian@Airm ●
Scanning...
Validating...
./index.rst:4: D000 Unknown target name: "example".
/Users/julian/.dotfiles/.local/share/virtualenvs/doc8/lib/python3.10/site-packages/doc8/parser.py:69: DeprecationWarning: The frontend.OptionParser class will be replaced by a subclass of argparse.ArgumentParser in Docutils 0.21 or later.
  opt = frontend.OptionParser(components=[parser], defaults=defaults)
/opt/homebrew/Cellar/[email protected]/3.10.9/Frameworks/Python.framework/Versions/3.10/lib/python3.10/optparse.py:1000: DeprecationWarning: The frontend.Option class will be removed in Docutils 0.21 or later.
  option = self.option_class(*args, **kwargs)
========
Total files scanned = 1
Total files ignored = 0
Total accumulated errors = 1
Detailed error counts:
    - doc8.checks.CheckCarriageReturn = 0
    - doc8.checks.CheckIndentationNoTab = 0
    - doc8.checks.CheckMaxLineLength = 0
    - doc8.checks.CheckNewlineEndOfFile = 0
    - doc8.checks.CheckTrailingWhitespace = 0
    - doc8.checks.CheckValidity = 1

~/Desktop/foo/docs is a git repository on main 
⊙  doc8 --version                                                                                                                 julian@Airm ●
1.0.0

flagging the link as an error, but this is incorrect, and make html will succeed just fine (and produce a page linking to the correct link target).

Julian added a commit to bowtie-json-schema/bowtie that referenced this issue Dec 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant