KhronosGroup / KhronosGroup/glTF
Enforce JSON formatting for schemas using CI checks
- Dominant language
- HTML
- Stars
- 7.8k
- Forks
- 1.2k
- Avg merge
- 17h 26m
- Merged PRs (30d)
- 5
Description
I noticed that some of the schemas have minor inconsistencies between them. Some have `"title":`, and some have a space before the colon `"title" :`. Some files have `"extensions": { },`, some files have `"extensions" : {},`.
Sometimes arrays have spaces:
```json
"required": [ "sampler", "target" ]
```
Sometimes they do not:
```json
"required": ["packet"]
```
Sometimes files have a mix of tabs and spaces:
```json
"output": "rotation",
"extensions" : {
"extension_name" : {
"extension specific" : "value"
}
},
"extras" : {
```
While these inconsistencies could be fixed manually, I think it makes sense for Khronos to pick one JSON style and enforce it via a JSON formatter in CI checks so that it stays consistent. I would recommend applying this to vendor extensions too (it only changes the formatting of the JSON, not its contents, so I think it's fine).
Aside from JSON formatting, it would also be a good idea to enforce UTF-8 and enforce POSIX compliance by having end of line at end of file. Currently many files have this, and many files don't.
Contributor guide
Research direction
Start by inventorying the schema JSON files, including vendor extensions, and locate how CI checks are configured; the issue names no specific files or tests. Choose a consistent formatter and define checks for JSON formatting, UTF-8 encoding, and a final POSIX newline, then verify the checks cover the schemas without changing their contents.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- json
- Domain
- ci-cd
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100