teemtee / fmf

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

Empty fmf file should mark that there exist node #131

Closed jscotka closed 3 years ago

jscotka commented 3 years ago

I have ucasese, that I've expected that also empty fmf file creates FMF node, but I've found that it is not true like:

mkdir x
cd x
fmf init
touch main.fmf
fmf ls

or more complex:

 echo a: b > main.fmf
touch a.fmf
touch b.fmf
mkdir c
touch c/main.fmf

or also way, to so simple inheritance in one file main.fmf:

a: b
/c: {}
/d: {}

So there is no way how to simply create inherited nodes, without any data in fmf files. But I think this way should exists.

psss commented 3 years ago

I think that empty fmf files could be considered as children which only inherit from the parent. Contrary to the empty directories which cannot represent fmf nodes otherwise it would not be possible to have any non-fmf directories, for example for additional test data. @lukaszachy, any concerns about creating an empty node (only inheriting from parent) for each empty file?

lukaszachy commented 3 years ago

Not at all. I slightly remember adding garbage attribute into one main.fmf just to have the node created :)

psss commented 3 years ago

Good, I'll have a look at that.

jscotka commented 3 years ago

Thanks, yep, this garbage attribute is also example when you have e.g. some fmf file like:

summary: Some basic test
test: ./runtest.sh

and you want to extend it by some env var e.g.

summary: Some basic test
test: ./runtest.sh
/python3.6
   environment:
      - PYTHON: python3.6
/default:
   garbage: attribute

to be able to test it with without defined env, with some default python

psss commented 3 years ago

Should be fixed by #133.