d2
d2 copied to clipboard
Validate command
Hi there!
I'm working on using D2 in my codebase, and in my tests I'd like to just parse the file to validate that the d2 code generated is valid, without actually generating a file.
I ended up implementing this as d2 graph.d2 /dev/null, which works but I think a CLI option would be better since many people don't know about /dev/null
Ah that's a good idea.
I think instead of a flag, this could just serve as its own command. d2 validate input.d2.
Hey @alixander, I am working on this one & I have a few questions.
- Should this command support multiple files streamlined together or a single file.
- Do I need to print something if the file is valid? like "
inputPathis valid"
@melsonic Awesome!
- I think just 1 file is fine.
- It can print out the errors