You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Many of the Arduino Lint rules related to the contents of the Arduino Project data files (library.properties, boards.txt, boards.local.txt, platform.txt, platform.local.txt, programmers.txt, package index) are based on a collection of JSON schemas:
It is possible that, in addition to their primary purpose of use internal to Arduino Lint, the schemas might be used by Arduino developers to obtain on the fly validations while editing these project configuration files, as is done with other common data files. High quality programming editors (e.g., VS Code) have the capability to use schemas in this way.
JSON Schema Store is a popular source of JSON schemas. There is some level of integration of the schemas listed on the store with common programming editors and IDEs:
🙂 Publishing the Arduino project data file JSON schemas on JSON Schema Store will make it easier for the Arduino community to discover and use these existing resources.
Describe the current behavior
The existence of the schemas is not advertised in any way.
🙁 It is likely that very few Arduino developers are aware of the availability of these schemas. Even after they become aware of their existence, it may be unnecessarily difficult to integrate them into a programming editor and maintain them.
Additional context
Hosting Strategy
JSON Schema Store allows self-hosting schemas, which would be convenient as it would allow us to continue maintaining only a single copy of these files. However, the use of $ref in the Arduino project schemas makes this impossible:
So it will be necessary to host the schemas in the SchemaStore/schemastore repository. Since work on the Arduino Lint codebase is often coupled with work in the schemas, removing the schemas from this repository and consuming the files from the JSON Schema Store would make development of Arduino Lint more difficult and time consuming so I think it will be best to host a copy of the schemas in the arduino/arduino-lint and SchemaStore/schemastore repositories both.
It will be important to keep these copies in sync (pushing changes made in the arduino/arduino-lint repository to JSON Schema Store as well as pulling in any changes that might have been made by contributors in the SchemaStore/schemastore repository). I recommend adding a GitHub Actions workflow to this repository to check for an out of sync state between the two copies. This can be done by downloading the schemas from JSON Schema Store and then doing a diff between the downloaded files and the files in the arduino/arduino-lint repository.
From my experience making several contributions to various schemas in the SchemaStore/schemastore repository over the years, I have been very impressed by the level of maintenance of the repository. High quality PRs are merged in a matter of days if not hours.
Usability of Schemas
The library.properties, boards.txt, boards.local.txt, platform.txt, platform.local.txt, and programmers.txt files use Arduino's bespoke "properties" data format. I fear this would make it quite difficult to integrate those JSON schemas into an editor in a useful capacity. I think the capability to parse the data files into a standard data structure would need to be implemented (which could be done using the github.com/arduino/go-properties-orderedmap Go module). So I'm not sure the very hypothetical benefits of publishing those schemas to the JSON Schema Store would be worth the effort to submit and maintain them on that platform.
Since the package index files use the standard JSON data format, I think the package index schema should be relatively easy to use.
Describe the request
Many of the Arduino Lint rules related to the contents of the Arduino Project data files (
library.properties
,boards.txt
,boards.local.txt
,platform.txt
,platform.local.txt
,programmers.txt
, package index) are based on a collection of JSON schemas:https://github.com/arduino/arduino-lint/tree/main/etc/schemas
It is possible that, in addition to their primary purpose of use internal to Arduino Lint, the schemas might be used by Arduino developers to obtain on the fly validations while editing these project configuration files, as is done with other common data files. High quality programming editors (e.g., VS Code) have the capability to use schemas in this way.
JSON Schema Store is a popular source of JSON schemas. There is some level of integration of the schemas listed on the store with common programming editors and IDEs:
https://www.schemastore.org/json/#editors
🙂 Publishing the Arduino project data file JSON schemas on JSON Schema Store will make it easier for the Arduino community to discover and use these existing resources.
Describe the current behavior
The existence of the schemas is not advertised in any way.
🙁 It is likely that very few Arduino developers are aware of the availability of these schemas. Even after they become aware of their existence, it may be unnecessarily difficult to integrate them into a programming editor and maintain them.
Additional context
Hosting Strategy
JSON Schema Store allows self-hosting schemas, which would be convenient as it would allow us to continue maintaining only a single copy of these files. However, the use of
$ref
in the Arduino project schemas makes this impossible:https://github.com/SchemaStore/schemastore/blob/master/CONTRIBUTING.md#how-to-ref-from-schema_xjson-to-schema_yjson
So it will be necessary to host the schemas in the
SchemaStore/schemastore
repository. Since work on the Arduino Lint codebase is often coupled with work in the schemas, removing the schemas from this repository and consuming the files from the JSON Schema Store would make development of Arduino Lint more difficult and time consuming so I think it will be best to host a copy of the schemas in thearduino/arduino-lint
andSchemaStore/schemastore
repositories both.It will be important to keep these copies in sync (pushing changes made in the
arduino/arduino-lint
repository to JSON Schema Store as well as pulling in any changes that might have been made by contributors in theSchemaStore/schemastore
repository). I recommend adding a GitHub Actions workflow to this repository to check for an out of sync state between the two copies. This can be done by downloading the schemas from JSON Schema Store and then doing a diff between the downloaded files and the files in thearduino/arduino-lint
repository.From my experience making several contributions to various schemas in the
SchemaStore/schemastore
repository over the years, I have been very impressed by the level of maintenance of the repository. High quality PRs are merged in a matter of days if not hours.Usability of Schemas
The
library.properties
,boards.txt
,boards.local.txt
,platform.txt
,platform.local.txt
, andprogrammers.txt
files use Arduino's bespoke "properties" data format. I fear this would make it quite difficult to integrate those JSON schemas into an editor in a useful capacity. I think the capability to parse the data files into a standard data structure would need to be implemented (which could be done using thegithub.com/arduino/go-properties-orderedmap
Go module). So I'm not sure the very hypothetical benefits of publishing those schemas to the JSON Schema Store would be worth the effort to submit and maintain them on that platform.Since the package index files use the standard JSON data format, I think the package index schema should be relatively easy to use.
Requested by @Freed-Wu at arduino/arduino-language-server#164 (comment)
Issue checklist
The text was updated successfully, but these errors were encountered: