summaryrefslogtreecommitdiff
path: root/utils/check_sources.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2016-11-07 13:15:18 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2016-11-16 12:05:44 +0900
commitdb732ac0b839a028a868a180550bb4f55d6e9b4b (patch)
treef6b13677407a36b0a12462ac15c1b22dd002a504 /utils/check_sources.py
parentde3e8580c4a2cfaca2c07c794d01c1e8eb0dd384 (diff)
downloadsphinx-git-db732ac0b839a028a868a180550bb4f55d6e9b4b.tar.gz
Prepare to type-check using mypy
Diffstat (limited to 'utils/check_sources.py')
-rwxr-xr-xutils/check_sources.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/utils/check_sources.py b/utils/check_sources.py
index 18d444057..d4a5ab491 100755
--- a/utils/check_sources.py
+++ b/utils/check_sources.py
@@ -46,6 +46,7 @@ copyright_2_re = re.compile(r'^ %s(, %s)*[,.]$' %
(name_mail_re, name_mail_re))
not_ix_re = re.compile(r'\bnot\s+\S+?\s+i[sn]\s\S+')
is_const_re = re.compile(r'if.*?==\s+(None|False|True)\b')
+noqa_re = re.compile(r'#\s+NOQA\s*$', re.I)
misspellings = ["developement", "adress", # ALLOW-MISSPELLING
"verificate", "informations"] # ALLOW-MISSPELLING
@@ -81,6 +82,8 @@ def check_syntax(fn, lines):
@checker('.py')
def check_style(fn, lines):
for lno, line in enumerate(lines):
+ if noqa_re.search(line):
+ continue
if len(line.rstrip('\n')) > 95:
yield lno+1, "line too long"
if line.strip().startswith('#'):