3 ms·
I wonder why IDE-enforced markup-schemas haven't caught on. Like a static type system for your markup (i.e. Kubernetes could declare your "types" and your edito
by brundolf 6y ago
I wonder why IDE-enforced markup-schemas haven't caught on. Like a static type system for your markup (i.e. Kubernetes could declare your "types" and your editor could ensure the config fits them).
VSCode has something along these lines for JSON - at least on its own settings configuration - but somehow the approach hasn't become prevalent. Are we lacking a standard? Motivation?
- FridgeSeal 6y agoThere's a Kubernetes plugin/package for Dhall [0] that can do this [1], it's very neat. I've played with it briefly, and whilst a tiny bit verbose (mostly as a function of the K8s specs themselves I suspect), the ability to have it validate everything before you even touched K8s was worth it imo. [0] https://dhall-lang.org/ https://dhall-lang.org/ [1] https://github.com/dhall-lang/dhall-kubernetes https://github.com/dhall-lang/dhall-kubernetes
- EdwardDiego 6y agoIDEA's K8s plugin validates its YAML. It's stricter than K8S itself though. K8s will accept a cpu value of 0.1, but the plugin marks it as an error, it wants the millicpu version 100m instead.
- ratorx 6y agoI had this exact problem a while ago when trying to have static types for blog entries. I ended up using a strategy where I would write the config in the language that I would eventually use it in (for my blog, my entries became typescript files). I think perhaps protobufs (specifically text format protos) are a potentially really nice solution, since you get to leverage the protobuf type system. Unfortunately the support for them is a bit lacking.... (afaik, no formal spec - there’s a canonical implementation in C++; no editor support for things like linting and completions).