diff --git a/mypy.ini b/mypy.ini new file mode 100644 --- /dev/null +++ b/mypy.ini @@ -0,0 +1,29 @@ +# To run mypy against Mercurial, do something like the following: +# +# $ python3.7 -m pip install mypy +# $ python3.7 mypy +# +# Note: Mercurial's source tree has source files that may not parse +# on the version of Python being targeted. Currently released versions +# of mypy treat parse errors as fatal. To work around this, install +# a mypy with the change from https://github.com/python/mypy/pull/7286 +# and uncomment the `ignore_parse_errors` line below. + +[mypy] +files = hgext/**/*.py, hgdemandimport/**/*.py, mercurial/**/*.py +cache_dir = build/mypy-cache + +# By default mypy targets the Python version it runs as. Mypy requires +# Python 3.5 to run. +python_version = 2.7 + +# Various functionality is optional. Suppress missing imports globally +# to cut down on noise. +ignore_missing_imports = True + +# TODO enable once feature lands upstream +# ignore_parse_errors = True + +# We don't control third party code. Don't error on it. +[mypy-mercurial.thirdparty.*] +ignore_errors = True