Comments (7)
I can imagine we could provide a metadata write feature which could do one of the following three levels of the scatteredness (not sure about how we should handle overwriting existing files):
- One huge
main.fmf
file containing the whole metadata tree - One
main.fmf
file plus additionalobject.fmf
files in a single directory - Separate
main.fmf
file for each metadata object, directories created as necessary
But what is the exact use case here? Do you expect some big batch changes in metadata? Would something like this be used often? Not sure it is worth to implement it.
from fmf.
Yep, exactly that is also my idea to use these tree base formats.
Would works similar to similar tools like autopep8
what formats your code to better style or helps you for example to transform your mismatch code in one single place to separated files in case you would like to rewrite it to more complex scenarios.
If it is often scenario hard to say. Also some tool what helps you generate metadata from another format can use it. like beakerlib format.
from fmf.
I think that good rule of thumb is: if you can make use of a tool that generates the meta-data for you automatically, then, well, do you really need the data in the first place? I understand why there could be use case fo some basic templaing, like generating test dir, but what kind of structure to use should be project-specific and wokflow-specific decision.
Ie. it should not be job of fmf but job of some wizard tool that is developed for the given project.
(Just my 2 satoshis.)
from fmf.
I think the fmf init
use case mentioned in #26 makes a good sense. I can imagine we could even provide fmf init --examples
which would populate the initialized metadata tree with a sample skeleton of metadata. Honza, would you be ok to, as the first step, limit scope of this issue for these two features?
from fmf.
@psss yep, exacly. it is my idea and this transforming could be now forgotten, because noone is directly interested.
And we can use this issue for this init and template generator
Maybe it could be more clever and for example generate this tree structure based on directories and files inside, like I can imagine, that:
.
├── sanity1
│ └── runtest.sh
└── sanity2
└── script.sh
and tooling like fmf init --element=test="glob.glob('*.sh')[0]" --element=tags="'[sanity]'"
can produce main.fmf
with content like:
/sanity1
test: runtest1.sh
tags: [sanity]
/sanity2
test: script1.sh
tags: [sanity]
it is very pythonish and very powerful generator ;-)
from fmf.
Interesting example with the glob
matching. For the start I would suggest to only support some static skeleton, something similar you get when you call beaker-wizard -yf
.
from fmf.
I've implemented it via #46
from fmf.
Related Issues (20)
- Add type annotations to fmf code HOT 1
- Case-sensitivity of context adjusting is unclear HOT 4
- Add distro and arch info to guests.yaml
- Merging for nested dictionaries defined in root HOT 1
- Replace jsonschema.RefResolver as is being deprecated HOT 2
- RFE: Support for merging phase metadata when multiple phases are used HOT 1
- Api documentation
- `.fmf/config` allow to redefine tree root relatively
- `.fmf/config` define type/flavor of an fmf tree
- Python improvements
- More `dict` and `Path` like api
- New project `fmf-jinja`
- Migrate `tmt.utils.field` and `tmt.utils.DataContainer` to `fmf` HOT 4
- Rewriting `fmf.Tree`
- Add callback to all methods changing node data HOT 2
- Keeping the 'node' as an object even though it has children and is not a leaf HOT 1
- Support additions to context made by adjust rules for follow-up rules HOT 1
- Missing `sdist` in PyPI HOT 1
- Add operator for REGEX matching in context HOT 1
- `context` should always populate `path` HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fmf.