From cf75cc27c297aea52410917ce66544deac540b3f Mon Sep 17 00:00:00 2001 From: Aminda Suomalainen Date: Sun, 22 Oct 2023 20:35:28 +0300 Subject: [PATCH] switch to pretty-format-json from prettier for json --- .editorconfig | 2 +- .pre-commit-config.yaml | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.editorconfig b/.editorconfig index 35a406b0..b189fe4c 100644 --- a/.editorconfig +++ b/.editorconfig @@ -91,6 +91,6 @@ end_of_line = crlf # YAML requires spaces. The GitHub citation files look YAML to me. # https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-citation-files -[*.{cff,yaml,yml}] +[*.{cff,yaml,yml,json}] indent_style = space indent_size = 2 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 67059c2c..589355bf 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -41,7 +41,7 @@ repos: - id: detect-private-key - id: fix-byte-order-marker #- id: check-docstring-first - #- id: check-json + - id: check-json - id: check-merge-conflict - id: check-toml - id: check-xml @@ -49,9 +49,10 @@ repos: #- id: fix-encoding-pragma #args: [--remove] - id: mixed-line-ending + args: [--fix=auto] + - id: pretty-format-json args: - [--fix=auto] - #- id: pretty-format-json + [--autofix, --no-ensure-ascii, --no-sort-keys] #- id: requirements-txt-fixer # Checks the ci: section on top of the file @@ -120,8 +121,8 @@ repos: rev: "v3.0.3" hooks: - id: prettier - # These are handled by Black below - exclude_types: [python, pyi, jupyter] + # These are handled by Black below or pretty-format-json above + exclude_types: [python, pyi, jupyter, json] additional_dependencies: [ # https://www.npmjs.com/package/prettier "prettier@3.0.3",