tools.codegenerator
subdirectory package part 1
#546
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I have been contributing to the
tools.codegenerator
module for several years.The
CodeGenerator
class was already large when I began my contributions.Since then, I have refactored it by redistributing responsibilities that were once overloaded onto a single class to other classes and functions.
Despite these efforts, the module remains over 1000 lines and is challenging to maintain. The recursive method that generates the codebase from
typedesc
objects complicates unit testing.While the
client
's tests confirm the code's executability, they do not assess the readability of line spacing and annotations.This PR and next ones aim to enhance future refactoring and testability by restructuring
tools.codegenerator
into a subdirectory package, store with an__init__.py
file and appropriately placed modules.