timesketch icon indicating copy to clipboard operation
timesketch copied to clipboard

Add Python type hints

Open rayanht opened this issue 4 years ago • 2 comments

It would be nice to introduce typing hints to the codebase. We could even potentially enforce them using pytype.

I don't know if it's already on the roadmap but if it isn't then I'd like to take up the task.

rayanht avatar Dec 16 '20 15:12 rayanht

Erratum: it seems like pytype operates without type annotations so a different tool would be required.

rayanht avatar Dec 16 '20 15:12 rayanht

this is already on the horizon but hasn't made it's way into the roadmap.

The idea was to start with the aPI client, then move on to the Importer client before moving into the rest of the codebase, adn then do them one-by-one.

This is a fairly large undertaking, since there are a lot of moving parts that need to be addressed, and also adding mypy to make sure that typing is strictly adhered to.

There was an attempt already to start in the API client, but there was an issue with py version needing to be at least 3.7 for the type of typing that was required to be available in the language. That was stopping us a bit, since we needed a feature in typing that was introduced in 3.7 and is part of the 3.8 moving forward. We may have to wait a bit until we can deprecate 3.6 for sure.

kiddinn avatar Dec 16 '20 15:12 kiddinn