Kiwi icon indicating copy to clipboard operation
Kiwi copied to clipboard

type annotations

Open danieleades opened this issue 1 year ago • 2 comments

this repo doesn't appear to use type annotations and the static analysis this unlocks. Is there any appetite for adding type annotations?

this could be done incrementally.

The expected benefit is that type annotations allow the use of static analysers such as mypy to prevent errors. Developer experience is also improved since type annotations also inform an IDE.

The Plan

  • [ ] add basic type checking infrastructure using mypy - #3153
  • [ ] tighten up the config, create a whitelist to allow incremental adoption
  • [ ] investigate django type checking (non-trivial)
  • [ ] ratchet up the type checking by shrinking the whitelist

danieleades avatar Apr 05 '23 09:04 danieleades

this could be done incrementally.

The core team has its focus on other items at the moment so feel free to open pull request(s).

atodorov avatar Apr 06 '23 19:04 atodorov

this could be done incrementally.

The core team has its focus on other items at the moment so feel free to open pull request(s).

I'll take a look and see how trivial it is/isn't...

My preferred approach is to apply a reasonably tight mypy config, and whitelist any files that cause errors (probably all of them). Over time the whitelist shrinks, and any newly-added files will be fully annotated from the start.

I don't mind submitting a few PRs, so long as the churn won't bother you?

danieleades avatar Apr 06 '23 20:04 danieleades