Merge "Use regex instead of prefix matches"
This commit is contained in:
commit
74f4a31087
|
@ -77,11 +77,11 @@ class CheckValidity(ContentCheck):
|
||||||
REPORTS = frozenset(["D000"])
|
REPORTS = frozenset(["D000"])
|
||||||
|
|
||||||
# Only used when running in sphinx mode.
|
# Only used when running in sphinx mode.
|
||||||
SPHINX_PREFIX_IGNORES = [
|
SPHINX_IGNORES_REGEX = [
|
||||||
'Unknown interpreted text',
|
re.compile(r'^Unknown interpreted text'),
|
||||||
'Unknown directive type',
|
re.compile(r'^Unknown directive type'),
|
||||||
'Undefined substitution',
|
re.compile(r'^Undefined substitution'),
|
||||||
'Substitution definition contains illegal element',
|
re.compile(r'^Substitution definition contains illegal element'),
|
||||||
]
|
]
|
||||||
|
|
||||||
def __init__(self, cfg):
|
def __init__(self, cfg):
|
||||||
|
@ -96,8 +96,8 @@ class CheckValidity(ContentCheck):
|
||||||
continue
|
continue
|
||||||
ignore = False
|
ignore = False
|
||||||
if self._sphinx_mode:
|
if self._sphinx_mode:
|
||||||
for m in self.SPHINX_PREFIX_IGNORES:
|
for m in self.SPHINX_IGNORES_REGEX:
|
||||||
if error.message.startswith(m):
|
if m.match(error.message):
|
||||||
ignore = True
|
ignore = True
|
||||||
break
|
break
|
||||||
if not ignore:
|
if not ignore:
|
||||||
|
|
Loading…
Reference in New Issue