-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Validate config file schema #236
Conversation
@mikavilpas can you have a look? |
config.sample.yaml
Outdated
@@ -1,4 +1,4 @@ | |||
# yaml-language-server: $schema=./schema.json | |||
# yaml-language-server: $schema=./config-file-schema.json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: could also use this to point to the latest schema version:
# yaml-language-server: $schema=./config-file-schema.json | |
# yaml-language-server: $schema=https://raw.githubusercontent.com/mfontanini/presenterm/master/config-file-schema.json |
I think the users that want to configure this can
- remove the entire comment if they prefer not using it
- change the URL to point to a different version, or even a local version
Note that this is not a permanent link; it always points to the latest master. Might require less user intervention this way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that's fair, this reduces the need to download extra files.
current_schema=$(mktemp) | ||
cargo run -q -- --generate-config-file-schema >"$current_schema" | ||
|
||
diff=$(diff "${root_dir}/config-file-schema.json" "$current_schema") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In practice I don't think this matters much but it doesn't hurt to add it 👌
810790c
to
3833ef2
Compare
This validates the config file JSON schema on every PR to ensure it's up to date.