teemtee / fmf

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

Add validate_fmf_id function #112

Closed thrix closed 3 years ago

thrix commented 3 years ago

Introduced to tmt, but seems useful directly in fmf library.

Signed-off-by: Miroslav Vadkerti mvadkert@redhat.com

thrix commented 3 years ago

/packit test

psss commented 3 years ago

I find the mapping implementation a bit cryptic. It also requires all fmf id dictionary keys to be defined. I think several if/elif statements would make the code much more readable. Also one brainstorming idea: What about throwing exceptions upon errors and returning just True when everything is fine? Seems more natural than return (True, ''). Also this could be directly handled in Tree.node() and this extra function would not be necessary.

thrix commented 3 years ago

we decided to drop this