You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a lot of the core logic, including CLI processing, contained presently in the __init__.py file, but since the main function of this file is to initialise the module rather than hold functional logic, I argue we should move at least some of this out to either existing, or new, other modules of the codebase.
Notably, there is input processing via CLI parsing and output processing:
all defined there, making the file over 300 lines long.
Unless there is a good reason these are defined there, we should move that logic out to appropriate modules, to keep the __init__.py lightweight module initialisation as per its intention.
Suggestion
I would personally move the CLI parsing out to a new module called cli.py and the CATSOutput and related logic to a new module output.py, or perhaps move all of it out to one new module called interface.py. Happy to take suggestions though, I am not tied to those as the solution.
The text was updated successfully, but these errors were encountered:
We have a lot of the core logic, including CLI processing, contained presently in the
__init__.py
file, but since the main function of this file is to initialise the module rather than hold functional logic, I argue we should move at least some of this out to either existing, or new, other modules of the codebase.Notably, there is input processing via CLI parsing and output processing:
cats/cats/__init__.py
Lines 29 to 33 in 34c951e
and output processing via the
CATSOutput
class:cats/cats/__init__.py
Lines 189 to 196 in 34c951e
all defined there, making the file over 300 lines long.
Unless there is a good reason these are defined there, we should move that logic out to appropriate modules, to keep the
__init__.py
lightweight module initialisation as per its intention.Suggestion
I would personally move the CLI parsing out to a new module called
cli.py
and theCATSOutput
and related logic to a new moduleoutput.py
, or perhaps move all of it out to one new module calledinterface.py
. Happy to take suggestions though, I am not tied to those as the solution.The text was updated successfully, but these errors were encountered: