GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — `pretty-format-json` stops formatting JSONs when it encounters one with incorrect format (e.g. JSON5 comments) · Issue #1038 · pre-commit/pre-commit-hooks

pretty-format-json stops formatting JSONs when it encounters one with incorrect format (e.g. JSON5 comments) #1038

New issue
Copy link
New issue
Copy link
Closed
#1039
Closed
pretty-format-json stops formatting JSONs when it encounters one with incorrect format (e.g. JSON5 comments)#1038
#1039
Copy link

Description

@amarvin
amarvin
opened on Apr 12, 2024
Issue body actions

Transferred from pre-commit/pre-commit#3124.

pretty-format-json prints "Input File {json_file} is not a valid JSON, consider using check-json" when it encounters an incorrectly formatted JSON file (e.g. with JSON5 comments), but it's not clear from that message that it then stops further processing files.

As pre-commit can partition the processed files into batches, this makes it even harder to tell as multiple batches of files can fail midway through with a few "X is not a valid JSON" messages printed, giving the impression that all the JSONs were formatted (or attempted formatted) and only those files printed are incorrect. The reality is that some JSONs may not have been formatted. I think this hook should try to format every JSON and only fail at the end if any have an invalid JSON format.

Activity

  1. amarvin
    changed the title [-]`pretty-format-json --all-files` stops formatting JSONs when it encounters one with incorrect format (e.g. JSON5 comments)[/-] [+]`pretty-format-json` stops formatting JSONs when it encounters one with incorrect format (e.g. JSON5 comments)[/+] on Apr 12, 2024
  2. asottile
    closed this as completedin #1039on Apr 20, 2024
  3. asottile
    added a commit that references this issue on Apr 20, 2024

    Merge pull request #1039 from amarvin/patch-1

    This issue will close once commit 528a309 is merged into the 'main' branch.
    528a309
  4. apricote
    added a commit that references this issue on Oct 9, 2024

    chore(deps): update pre-commit hook pre-commit/pre-commit-hooks to v5…

    7630cef
  5. sai-rekhawar
    added a commit that references this issue on Jul 1, 2025

    Merged PR 5366: Update pre-commit hook pre-commit/pre-commit-hooks to v5

    77776f4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402520 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.