Nihilate / Roboragi

Roboragi is a Reddit bot which helps link anime, manga, and other Japanese media.
GNU Affero General Public License v3.0
167 stars 30 forks source link

Add type annotations to AnimePlanet.py #76

Closed reillysiemens closed 2 years ago

reillysiemens commented 5 years ago

I had a little bit of extra time this evening, so I thought I'd take a crack at addressing a trivial part of #52. This just adds type annotations for roboragi/AnimePlanet.py and puts some known mypy files into the .gitignore.

There were a few types that seemed ambiguous that I guessed at (like the animeId and mangaId arguments which come from a table in the SQLite database that I don't think has an explicit schema) and the authorName variable, which I don't think is actually used by any calling code. If I've erred in assessing those types just let me know and I can adjust.

I should also note that in contrast to #75, this only adds type annotations on function signatures. I'm not sure if you'd prefer to add them everywhere, but I'll be happy to adjust that to your preference as well, @Nihilate. Myself, I tend to only add them on the function signatures and where there's ambiguity that mypy complains about.

Running mypy against roboragi/AnimePlanet.py after these changes

[19:29:10] venv:(roboragi) tucker@khanti:~/Projects/Roboragi git:(enhancement/type-annotations) § mypy roboragi/AnimePlanet.py                   
Success: no issues found in 1 source file
[19:29:20] venv:(roboragi) tucker@khanti:~/Projects/Roboragi git:(enhancement/type-annotations) §
reillysiemens commented 4 years ago

@Nihilate: Is this a contribution you're interested in taking?