diff options
author | Georg Brandl <georg@python.org> | 2016-02-25 19:14:10 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2016-02-25 19:14:10 (GMT) |
commit | 2305b3cde3406f3a0ee7ff8c858bce5d372c77ae (patch) | |
tree | f067ae97d04bc5821c5623d45724fd5fd31f0473 /Doc/tools/rstlint.py | |
parent | eae3336e425a718d6c17ee1247236a62080bac7f (diff) | |
download | cpython-2305b3cde3406f3a0ee7ff8c858bce5d372c77ae.zip cpython-2305b3cde3406f3a0ee7ff8c858bce5d372c77ae.tar.gz cpython-2305b3cde3406f3a0ee7ff8c858bce5d372c77ae.tar.bz2 |
Fix rstlint to also look for indented comments that should be directives.
Diffstat (limited to 'Doc/tools/rstlint.py')
-rwxr-xr-x | Doc/tools/rstlint.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Doc/tools/rstlint.py b/Doc/tools/rstlint.py index 7dccf72..de78041 100755 --- a/Doc/tools/rstlint.py +++ b/Doc/tools/rstlint.py @@ -43,7 +43,7 @@ directives = [ ] all_directives = '(' + '|'.join(directives) + ')' -seems_directive_re = re.compile(r'\.\. %s([^a-z:]|:(?!:))' % all_directives) +seems_directive_re = re.compile(r'(?<!\.)\.\. %s([^a-z:]|:(?!:))' % all_directives) default_role_re = re.compile(r'(^| )`\w([^`]*?\w)?`($| )') leaked_markup_re = re.compile(r'[a-z]::\s|`|\.\.\s*\w+:') @@ -83,7 +83,7 @@ def check_suspicious_constructs(fn, lines): """Check for suspicious reST constructs.""" inprod = False for lno, line in enumerate(lines): - if seems_directive_re.match(line): + if seems_directive_re.search(line): yield lno+1, 'comment seems to be intended as a directive' if '.. productionlist::' in line: inprod = True |