Skip to content

v1.3.0

Choose a tag to compare

@simonvanlierde simonvanlierde released this 13 Oct 00:59
· 55 commits to main since this release
f1251df

Upgrade: set rev: v1.3.0. Nothing else is needed for the hook. Only a script that parses the
hook's output, or imports pre_commit_hooks.check_json5, needs a change (see Changed).

Added

  • Every failure prints as file:line:col: message, so editors and terminals link to it.
  • A duplicate key reports its JSON path ($.server.port), and every repeated key in a file is
    listed, not only the first.
  • On GitHub Actions, each failure is also an annotation on the pull request diff.
  • --strict GLOB holds matching files to strict JSON: no comments, trailing commas or NaN.
    Repeat it to add patterns, and !GLOB exempts files.
  • Published on PyPI, so uvx check-json5 FILE... works without pre-commit.

Changed

  • The output format: f.json: Failed to json decode (<string>:4 Unexpected "," at column 8) is
    now f.json:4:8: Unexpected ",".
  • The module moved from pre_commit_hooks.check_json5 to check_json5.check_json5, so the PyPI
    package no longer collides with pre-commit-hooks. The check-json5 command is unchanged.
  • Tested on Python 3.15.

Fixed

  • A file nested deeper than Python's recursion limit crashed the run and left the remaining files
    unchecked. It now fails on its own.
  • Valid JSON with an integer of more than 4300 digits failed.