teemtee / fmf

Flexible Metadata Format
GNU General Public License v2.0
22 stars 28 forks source link

Rewriting `fmf.Tree` #217

Open LecrisUT opened 9 months ago

LecrisUT commented 9 months ago

Proposal

The fmf.Tree constructor could be re-worked go like: fmf.Tree.__new__() -> files -> fmf.RawTree (collector/parser/operator) -> json_validator (also populates default) -> final fmf.Tree (subclass) -> tmt consumes it

If we go for attrs, that would be in between json_validator and constructing the fmf.Tree, where depending on which schema is validated, the appropriate subclass of fmf.Tree (e.g. tmt.plan) is constructed which would be an attrs.define decorated subclass. Additional converters, validators would come from attrs after that.