aboutsummaryrefslogtreecommitdiff
path: root/run_mypy.py
diff options
context:
space:
mode:
authorDaniel Mensinger <daniel@mensinger-ka.de>2020-08-28 19:29:20 +0200
committerDaniel Mensinger <daniel@mensinger-ka.de>2020-09-08 20:15:56 +0200
commitbb09ca9ad551e00780dbd6a12ae1619859d4bc6a (patch)
treedd987a44080c9c972368fc0a62e69d772487f916 /run_mypy.py
parentce042f318e56f94afca7b92364728e02d068b30e (diff)
downloadmeson-bb09ca9ad551e00780dbd6a12ae1619859d4bc6a.zip
meson-bb09ca9ad551e00780dbd6a12ae1619859d4bc6a.tar.gz
meson-bb09ca9ad551e00780dbd6a12ae1619859d4bc6a.tar.bz2
typing: fully annotate mesonlib.py
Diffstat (limited to 'run_mypy.py')
-rwxr-xr-xrun_mypy.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/run_mypy.py b/run_mypy.py
index 68fa344..e9b8229 100755
--- a/run_mypy.py
+++ b/run_mypy.py
@@ -2,6 +2,7 @@
import sys
import subprocess
+import argparse
from pathlib import Path
import typing as T
@@ -29,9 +30,10 @@ normal_modules = [
strict_modules = [
'mesonbuild/interpreterbase.py',
- # 'mesonbuild/mesonlib.py',
+ 'mesonbuild/mesonlib.py',
'mesonbuild/mlog.py',
'mesonbuild/ast',
+ 'run_mypy.py',
]
normal_args = ['--follow-imports=skip']
@@ -44,6 +46,8 @@ strict_args = normal_args + [
'--disallow-untyped-defs',
'--disallow-incomplete-defs',
'--disallow-untyped-decorators',
+ '--no-implicit-optional',
+ '--strict-equality',
# '--disallow-any-expr',
# '--disallow-any-decorated',
# '--disallow-any-explicit',
@@ -70,6 +74,14 @@ def main() -> int:
res = 0
check_mypy()
+ parser = argparse.ArgumentParser(description='Process some integers.')
+ parser.add_argument('-p', '--pretty', action='store_true', help='pretty print mypy errors')
+
+ args = parser.parse_args()
+ if args.pretty:
+ normal_args.append('--pretty')
+ strict_args.append('--pretty')
+
print('Running normal mypy check...')
res += run_mypy(normal_args, normal_modules)