marcusbuffett / command-line-chess

A python program to play chess against an AI in the terminal.
MIT License
500 stars 162 forks source link

Configure mypy and type annotate the code #41

Closed aaaandrzej closed 2 years ago

aaaandrzej commented 2 years ago

Fixed #35

This PR adds mypy to this project and the required types to the codebase.

It also adds a bunch of TODOs as mypy uncovered a couple of issues within the code, like inconsistent types or missing returns. I didn't want to introduce any significant changes to the code as part of this PR so I decided to let mypy ignore these for now, but with relevant TODOs so these can be addressed later.

Running mypy --show-error-codes --pretty --strict . on this code: Success: no issues found in 16 source files

Running the same command on recent master: Found 370 errors in 14 files (checked 16 source files)

aaaandrzej commented 2 years ago

Discussed fixes pushed, feel free to re-review when you have a sec.

ClasherKasten commented 2 years ago

I felt so free and resolved the merging conflict created by merging #43.