glazewm
glazewm copied to clipboard
feat: Add json schema for config
- [x] hints for documented properties in README.md
- [x] links to README.md in hints
- [x] property format validation
@EmilyGraceSeville7cf Wow, thanks for taking the time to do this 🙌 I've used JSON schemas for JSON files (eg. tsconfig, prettier etc), but have never used them for YAML before. How do I use these as an end user?
Also, would you happen to know whether SchemaStore accepts YAML configs like this one?
How do I use these as an end user?
There are plenty of options available for u in this case:
- you can use some of CLI validators to manually validate your config for correctness (I recommend it to be used in GitHub actions for instance)
- also you can install VS Code YAML Red Hat extension and refer to this schema like this:
# yaml-language-server: $schema={{this_schema_url}}
- but the best option to put this schema here, refer to it in SchemaStore repository and thus make VS Code automatically enable hints for GlazeWM configs in VS Code thanks to the extension mentioned above (I can do it)
Also, would you happen to know whether SchemaStore accepts YAML configs like this one?
JSON schema is suitable for validating YAML documents, if I correctly inferred what you meant. ;)
I finished my PR. I need a review, because I have some doubts about what properties should be marked as required (it's not documented).
P.S. I recommend make this schema autogenerated later in C#, but I can't help you here, I don't know this language.
@lars-berger, can you review this PR?
I noticed the schema has an error with workspaces/bind_to_monitor
its marked as a boolean when it should be an integer?
@JustBarnt, I've fixed this problem. 😄