Skip to content

Add type annotations

Add type annotations to osf.py. This MR adds basic type annotations to all function definitions in osf.py. Unfortunately, because perceval does not include type annotations itself, this isn't perfect, but it does add some more static analysis. Notably, during the addition of type annotations, two type errors were caught.

Firstly, it is possible to call .fetch_items() without defining .client in Osf, which has been turned into an explicit and helpful (I hope) error.

Secondly, .metadata_category returns a List instead of a str, which I'm pretty sure is the incorrect behavior. I've currently replaced it with a stub and a TODO, but please look it over to make sure I'm interpreting it correctly.

Merge request reports

Loading