From db732ac0b839a028a868a180550bb4f55d6e9b4b Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Mon, 7 Nov 2016 13:15:18 +0900 Subject: Prepare to type-check using mypy --- utils/check_sources.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'utils/check_sources.py') 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('#'): -- cgit v1.2.1