Disable AnchorCheck plugin

Can't be relied on. Multiple reports of expected results not returned.

https://github.com/linkchecker/linkchecker/issues/542
https://github.com/linkchecker/linkchecker/issues/555
https://github.com/linkchecker/linkchecker/issues/568

Previously a fix was needed just to get the tests working:
0912e8a2c ("Don't strip the URL fragment from cache key if using AnchorCheck", 2020-07-27)

After:
eaa538c81 ("don't check one url multiple times", 2016-11-09)
This commit is contained in:
Chris Mayo 2021-11-29 19:35:34 +00:00
parent 822c607a33
commit 0356524369
2 changed files with 12 additions and 0 deletions

View file

@ -26,8 +26,16 @@ from ..htmlutil import linkparse
class AnchorCheck(_ContentPlugin):
"""Checks validity of HTML anchors."""
def __init__(self, config):
"""Initialize plugin."""
super().__init__(config)
log.warn(
LOG_PLUGIN, _("Anchor check plugin is broken. Fixes welcome.")
)
def applies_to(self, url_data):
"""Check for HTML anchor existence."""
return False # XXX Plugin disabled
return url_data.is_html() and url_data.anchor
def check(self, url_data):

View file

@ -16,6 +16,8 @@
"""
Test html anchor parsing and checking.
"""
import pytest
from . import LinkCheckTest
from .httpserver import HttpServerTest
@ -25,6 +27,7 @@ class TestAnchor(LinkCheckTest):
Test anchor checking of HTML pages.
"""
@pytest.mark.xfail(strict=True)
def test_anchor(self):
confargs = {"enabledplugins": ["AnchorCheck"]}
url = "file://%(curdir)s/%(datadir)s/anchor.html" % self.get_attrs()
@ -46,6 +49,7 @@ class TestHttpAnchor(HttpServerTest):
Test checking of HTML pages containing links to anchors served over http.
"""
@pytest.mark.xfail(strict=True)
def test_anchor_html(self):
confargs = dict(enabledplugins=["AnchorCheck"], recursionlevel=1)
self.file_test("http_anchor.html", confargs=confargs)