OpenHands icon indicating copy to clipboard operation
OpenHands copied to clipboard

style: enhancing type strictness with mypy

Open omutist opened this issue 1 year ago • 3 comments

The mypy configuration has been updated for stricter static type checking in accordance with mypy guidelines. Type annotations have been added to the code as recommended by mypy. Given that the project's Python version is 3.11 or higher, types from the typing package (List, Dict, Type, Tuple) have been replaced with their native counterparts (list, dict, type, tuple) in the codebase. It is advisable to employ native types in new code.

mypy was already integrated into git pre-commit hook. Not sure about CI integration.

omutist avatar Apr 10 '24 00:04 omutist

The PR appears to be impacted by changes made by autopep8, primarily involving the substitution of double quotes with single quotes.

omutist avatar Apr 10 '24 00:04 omutist

Sorry for the merge conflicts!

rbren avatar Apr 10 '24 22:04 rbren

@omutist how do you want to proceed with this PR?

Generally I'd suggest that any style/enforcement get applied only as files change, so that we don't have massive merge conflicts

rbren avatar Apr 16 '24 14:04 rbren

Going to close this one as stale. Happy to continue the discussion in Slack though!

rbren avatar Apr 20 '24 13:04 rbren