Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: François Freitag <mail@franek.fr>
  • Loading branch information
croth1 and francoisfreitag committed Dec 6, 2021
1 parent efa6482 commit 376e3a6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Features added
``__all__`` attribute if :confval:`autosummary_ignore_module_all` is set to
``False``. The default behaviour is unchanged. Autogen also now supports
this behavior with the ``--respect-module-all`` switch.
* #9894: linkcheck: new option`linkcheck_exclude_documents` allows to disable
* #9894: linkcheck: add option `linkcheck_exclude_documents` to disable link checking in matched documents.
link check in matched documents.

Bugs fixed
Expand Down
2 changes: 1 addition & 1 deletion sphinx/builders/linkcheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ def check(docname: str) -> Tuple[str, str, int]:

for doc_matcher in self.documents_exclude:
if doc_matcher.match(docname):
return 'unchecked', '', 0
return 'ignored', f'{docname} matched {doc_matcher} from linkcheck_exclude_documents', 0

if len(uri) == 0 or uri.startswith(('#', 'mailto:', 'tel:')):
return 'unchecked', '', 0
Expand Down
3 changes: 1 addition & 2 deletions tests/test_build_linkcheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -629,8 +629,7 @@ def test_get_after_head_raises_connection_error(app):

@pytest.mark.sphinx('linkcheck', testroot='linkcheck-documents_exclude', freshenv=True)
def test_linkcheck_exclude_documents(app):
with http_server(make_redirect_handler(support_head=False)):
app.build()
app.build()

with open(app.outdir / 'output.json') as fp:
for record in fp:
Expand Down

0 comments on commit 376e3a6

Please sign in to comment.