lint: enable mypy checking for missing imports

Achieve this by adding some ignore, and making data/ importable.

Co-authored-by: João Barbosa <joao.paulo.barbosa@gmail.com>
This commit is contained in:
josibakeandJoão Barbosa authored and fanquake committed 2021-10-16 09:14:37 +08:00
1 parent 22e652662b
commit a46f71bb70
6 files changed
+5 -5

No files matched your search

+1 -1
View File
@@ -10,7 +10,7 @@ Otherwise the exit status will be 1 and it will log which executables failed whi
import sys import sys
from typing import List from typing import List
import lief import lief #type:ignore
def check_ELF_RELRO(binary) -> bool: def check_ELF_RELRO(binary) -> bool:
''' '''
+1 -1
View File
@@ -13,7 +13,7 @@ Example usage:
import sys import sys
from typing import List, Dict from typing import List, Dict
import lief import lief #type:ignore
# temporary constant, to be replaced with lief.ELF.ARCH.RISCV # temporary constant, to be replaced with lief.ELF.ARCH.RISCV
# https://github.com/lief-project/LIEF/pull/562 # https://github.com/lief-project/LIEF/pull/562
+1 -1
View File
@@ -188,7 +188,7 @@ def print_logs_plain(log_events, colors):
def print_logs_html(log_events): def print_logs_html(log_events):
"""Renders the iterator of log events into html.""" """Renders the iterator of log events into html."""
try: try:
import jinja2 import jinja2 #type:ignore
except ImportError: except ImportError:
print("jinja2 not found. Try `pip install jinja2`") print("jinja2 not found. Try `pip install jinja2`")
sys.exit(1) sys.exit(1)
View File
Whitespace-only changes.
+1 -1
View File
@@ -40,7 +40,7 @@ except UnicodeDecodeError:
CROSS = "x " CROSS = "x "
CIRCLE = "o " CIRCLE = "o "
if os.name != 'nt' or sys.getwindowsversion() >= (10, 0, 14393): if os.name != 'nt' or sys.getwindowsversion() >= (10, 0, 14393): #type:ignore
if os.name == 'nt': if os.name == 'nt':
import ctypes import ctypes
kernel32 = ctypes.windll.kernel32 # type: ignore kernel32 = ctypes.windll.kernel32 # type: ignore
+1 -1
View File
@@ -102,7 +102,7 @@ if ! PYTHONWARNINGS="ignore" flake8 --ignore=B,C,E,F,I,N,W --select=$(IFS=","; e
EXIT_CODE=1 EXIT_CODE=1
fi fi
if ! mypy --ignore-missing-imports --show-error-codes $(git ls-files "test/functional/*.py" "contrib/devtools/*.py"); then if ! mypy --show-error-codes $(git ls-files "test/functional/*.py" "contrib/devtools/*.py"); then
EXIT_CODE=1 EXIT_CODE=1
fi fi