Skip to content

log files are not valid json format #325

@rruiter87

Description

@rruiter87

It is a small issue, but annoying non the less. When I try to commit a json log file, it gets flagged by the json5 pre-commit hook.

check json5..............................................................Failed
- hook id: check-json5
- exit code: 1

log.json: Failed to json decode (<string>:2 Unexpected "{" at column 1)

Possible solutions:

  1. Read of the original file, update it and write the whole updated json
  2. Do not use the .json extension as stated the documentation, but for example txt instead.
  3. Hacky way would be to write a [ on first opening of the file. And on subsequent writes start with a ,. After the last write do a ].

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions