Skip to content

Commit a46f71b

Browse files
josibakepromag
authored andcommitted
lint: enable mypy checking for missing imports
Achieve this by adding some ignore, and making data/ importable. Co-authored-by: João Barbosa <[email protected]>
1 parent 22e6526 commit a46f71b

File tree

6 files changed

+5
-5
lines changed

6 files changed

+5
-5
lines changed

contrib/devtools/security-check.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import sys
1111
from typing import List
1212

13-
import lief
13+
import lief #type:ignore
1414

1515
def check_ELF_RELRO(binary) -> bool:
1616
'''

contrib/devtools/symbol-check.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import sys
1414
from typing import List, Dict
1515

16-
import lief
16+
import lief #type:ignore
1717

1818
# temporary constant, to be replaced with lief.ELF.ARCH.RISCV
1919
# https://github.com/lief-project/LIEF/pull/562

test/functional/combine_logs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ def print_logs_plain(log_events, colors):
188188
def print_logs_html(log_events):
189189
"""Renders the iterator of log events into html."""
190190
try:
191-
import jinja2
191+
import jinja2 #type:ignore
192192
except ImportError:
193193
print("jinja2 not found. Try `pip install jinja2`")
194194
sys.exit(1)

test/functional/data/__init__.py

Whitespace-only changes.

test/functional/test_runner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
CROSS = "x "
4141
CIRCLE = "o "
4242

43-
if os.name != 'nt' or sys.getwindowsversion() >= (10, 0, 14393):
43+
if os.name != 'nt' or sys.getwindowsversion() >= (10, 0, 14393): #type:ignore
4444
if os.name == 'nt':
4545
import ctypes
4646
kernel32 = ctypes.windll.kernel32 # type: ignore

test/lint/lint-python.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ if ! PYTHONWARNINGS="ignore" flake8 --ignore=B,C,E,F,I,N,W --select=$(IFS=","; e
102102
EXIT_CODE=1
103103
fi
104104

105-
if ! mypy --ignore-missing-imports --show-error-codes $(git ls-files "test/functional/*.py" "contrib/devtools/*.py"); then
105+
if ! mypy --show-error-codes $(git ls-files "test/functional/*.py" "contrib/devtools/*.py"); then
106106
EXIT_CODE=1
107107
fi
108108

0 commit comments

Comments
 (0)