-
-
Notifications
You must be signed in to change notification settings - Fork 544
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
Should we use $Schema in config.json? #1972
Comments
What would that do? |
Aha, I should have mentioned that of course. For maintainers, it means IDEs pick up the schema automatically and checks the file against it. |
IDEs (like VSCode) can also offer suggestions on keys and what type of data the keys expect |
I sort of like the idea, but I have two concerns:
|
For your points @ErikSchierboom :
Registering such schemata in https://github.com/schemastore/schemastore/ is one of the ways of having hem made available to IDE's. |
I briefly checked support for JSON schema in Nim, and I don't think there's anything great. IIRC, I found one library that could do JSON schema validation but its error messages were quite unwieldy.
True. As we wouldn't want to download the schema each time we do linting, we'd need to cache it. My main concern with using JSON schema is that we'd some of the flexibility that we have now, where there can be complex rules with very specific and detailed descriptions. @ee7 what do you think? |
I will try to assess the Nim support a bit more then. Another question, I notice in the code comments for configlet that there is mention of avoiding the PCRE Regex lib, do you know the reason behind this? It may impact how useful a schema could be too. |
I know practically nothing about Nim, configlet, JSON schemas, and regex, sorry :D |
My take: I think it's fine to add a schema, to help people catch basic errors while editing. But I don't think I'm not a JSON schema expert, but I'd guess that we have rules (and theoretically could have new rules in the future) that are either awkward or impossible to express in JSON schema. Can a schema express this?
There will also be checks that require a network connection. For example:
Here, to determine validity, you need an up to date list of every concept exercise on every track. Another one: checking that a UUID is unique across all of Exercism. ( And if there's a single rule that a schema cannot check, then there's a difference between
We want configlet to be a zero-dependency binary, as far as possible. If we use the Nim stdlib There is a regex package written in pure Nim, which would avoid the run-time dependency. But it's rarer to reach for regular expressions in Nim than in other languages anyway - |
Pretty much as the title says, should we add usage of
$Schema
to the trackconfig.js
and exercise.meta/config.js
to reference the related schema?The text was updated successfully, but these errors were encountered: