static-analysis-engineering / CodeHawk-Binary

CodeHawk Binary Analyzer for malware analysis and general reverse engineering
MIT License
21 stars 9 forks source link

WIP: Typing fixes #156

Closed waskyo closed 1 month ago

waskyo commented 1 month ago

Slowly working through fixing some minor typing issues in CH.

Some of these required adding a local mypy.ini file for mypy to complain:

[mypy]

# Options to make the checking stricter.
check_untyped_defs = True
disallow_untyped_defs = True
disallow_untyped_calls = True

I did not add that file to this branch yet.

Currently, I still have these mypy errors which will require a bit more work to fix:

chb/app/Cfg.py:578: error: Function is missing a type annotation  [no-untyped-def]
chb/app/Cfg.py:583: error: Call to untyped function "switch_case_stmts" in typed context  [no-untyped-call]
chb/tests/ELFThumbDisassemblyTestSet.py:54: error: Function is missing a type annotation for one or more arguments  [no-untyped-def]
chb/tests/ELFThumbDisassemblyTestSet.py:66: error: Function is missing a type annotation for one or more arguments  [no-untyped-def]
chb/tests/ELFThumbDisassemblyTestSet.py:72: error: Function is missing a type annotation for one or more arguments  [no-untyped-def]
chb/tests/ELFThumbDisassemblyTestSet.py:78: error: Function is missing a type annotation for one or more arguments  [no-untyped-def]
Found 6 errors in 2 files (checked 779 source files)

I'm using mypy version 1.10.0 locally.