Replies: 1 comment 4 replies
-
I can imagine moving some of the functionality into fmf library, e.g. the block checking whether a tree already exists, or whether we're creating a nested tree, could be useful in general, not just in tmt. The method could be simplified for sure.
Yes, it does, like many other classes derived from
While I don't mind simplifying |
Beta Was this translation helpful? Give feedback.
-
There is
Tree.init()
static method that way too confusing.tmt/tmt/base.py
Lines 3075 to 3076 in f4a0480
It creates another instance of
Tree
down the line.tmt/tmt/base.py
Line 3090 in f4a0480
And then sometime even
Tree
with other arguments.tmt/tmt/base.py
Line 3110 in f4a0480
But this
base.py
Tree.init() contains very user specific and high level logic, like committing paths to.git
repository. I expect this to be a standalone function, either inbase.py
or in some command file. Like factor out these two lines into actual command logic.tmt/tmt/cli.py
Lines 1620 to 1621 in f4a0480
The Tree even has some helpers to store cli invokation context? What? It looks like a God Class (https://linearb.io/blog/what-is-a-god-class).
So, how about moving this stuff out? At least the init method?
Beta Was this translation helpful? Give feedback.
All reactions