Refactor mkchromecast to make __init__.py
minimal and avoid import __init__
#425
Labels
codehealth
Tasks focused on improving the maintainability of the codebase
As implemented, there's a lot of work being done in
__init__.py
that should be done elsewhere.bin/mkchromecast
mkchromecast
library should be designed as a library, with one or more classes that encapsulate the functionality, can be instantiated with appropriate arguments, and can be unit-tested independentlyimport mkchromecast.__init__
. This is a code smell. Especially given that mkchromecast is a binary + library pair,__init__.py
shouldn't do any work, and should only present the external API of the library. The modules in the library should import things directly, and shouldn't pass back through__init__.py
.__init__.py
is used in this way because mkchromecast uses a lot of global variables and very little encapsulation. This is also a code smell, and makes the code difficult to unit test effectively.The text was updated successfully, but these errors were encountered: