Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
FEATURE : Add `strictyaml` command-line tool #55
Future work: Schema validation would be nice, and it would be great to report all errors in a file, rather than just the first one, but this is very useful on its own.
Hi @9999years Thanks for your PR and sorry for the delay getting back to you (busy weekend).
Thanks also for BDD'ing this with the framework. I'm impressed (you're the first person to do this so far).
I've been pondering this new feature over the weekend and while I like the feature a lot I feel like it overstretches the remit of what the strictyaml library should provide. I would like to have a CLI tool of some kind as part of a different library and then include it as part of a suite of StrictYAML tools.
Would it be possible to separate this out into a separate library (e.g. strictyaml-cli) ? I can then link to the library near the top of the README.
Yes, that sounds reasonable. Would you be willing to take ownership over the library once I package / complete it?
Further, do you think exposing some API for all the errors in a file would be doable / easy? I didn't look at the parser code in a lot of depth, but I didn't see an obvious place it would be exposed.
If it demonstrates some level of popularity/usage, yes. I don't currently have a use for it but if many others do I'd be delighted to maintain it. I'd be equally happy to promote your role in it.
Unfortunately not right now. The code is architected to raise an exception on the first issue it encounters and stop. Even more unfortunately, the library is also dependent upon another library (ruamel.yaml) that follows the same behavior when doing the raw parsing. Long term - I would like to remove the dependency on this library #56 but that's also quite a lot of work.
Moreover, since I couldn't see a pressing need for this feature (it was raised in #15 but as far as I could tell it was raised as a nice to have), I'm a bit reticent to do all this underpinning architectural work to make it possible if that is the case. I typically run the parser -> encounter errors -> fix them -> run the parser again -> encounter errors again -> fix them -> run the parser until everything passes and this workflow is currently accommodated. I assume that most others do the same.
That said, I always love to hear use cases and if there is one that demonstrates a clear and pressing need for this feature I'd be happy to move towards implementing it.