Skip to content
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

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

Open
kbroch-rivosinc opened this issue Nov 14, 2024 · 2 comments
Open
Labels
data error An error in the database data

Comments

@kbroch-rivosinc
Copy link
Collaborator

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.

@kbroch-rivosinc kbroch-rivosinc added the data error An error in the database data label Nov 14, 2024
@dhower-qc
Copy link
Collaborator

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
Copy link
Collaborator Author

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:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data error An error in the database data
Projects
None yet
Development

No branches or pull requests

2 participants