riscv-software-src / riscv-unified-db

Machine-readable database of the RISC-V specification, and tools to generate various views
Other
19 stars 15 forks source link

illegal comment in json file flagged by pre-commit check-json #267

Open kbroch-rivosinc opened 1 week ago

kbroch-rivosinc commented 1 week ago

This might be a don't care but currently this file: https://github.com/riscv-software-src/riscv-unified-db/blob/main/.devcontainer/devcontainer.json#L12 is marked as .json and therefore can't have comments.

❯ pre-commit run --all-files check-json
check json...............................................................Failed
- hook id: check-json
- exit code: 1

.devcontainer/devcontainer.json: Failed to json decode (Expecting property name enclosed in double quotes: line 12 column 3 (char 359))

If this format is acceptable for devcontainers I'd suggest renaming it .json5 If not we can just ignore it when check-json is put in place.

dhower-qc commented 1 week ago

I'm not sure we can rename it to .json5. According to the devcontainer spec, this file must be named devcontainer.json. Further, the spec says it is "JSON with comments," not specifically JSON5.

kbroch-rivosinc commented 1 week ago

Ok In the short term, this file can just be removed from check-json hook.

In the long term, I'll see about getting a check-json-with-comments in pre-commit-hooks repo where it has already been discussed here: