From e5560cdbf44eee4a06dd432b3041609ec1a45edd Mon Sep 17 00:00:00 2001 From: Se7enZ Date: Tue, 17 Dec 2024 11:25:28 +0100 Subject: [PATCH] chore: Add doc JSON schema checks and formatting to pre-commit. --- .pre-commit-config.yaml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d33ba8f8f50b..d6a9d0e1965a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -30,6 +30,29 @@ repos: entry: clang-format types: [ c ] +- repo: https://github.com/python-jsonschema/check-jsonschema + rev: 0.30.0 + hooks: + - id: check-jsonschema + name: check doc JSON schemas + args: ["--schemafile", "doc/rpc-schema-draft.json"] + files: ^doc/schemas/.*\.json$ + types: [ json ] + + - id: check-metaschema + name: check doc JSON metaschemas + args: ["--verbose"] + files: ^doc/schemas/.*\.json$ + types: [ json ] + +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v5.0.0 + hooks: + - id: pretty-format-json + args: [ "--indent", "2", "--no-sort-keys" ] + files: ^doc/schemas/.*\.json$ + types: [ json ] + - repo: https://github.com/codespell-project/codespell rev: v2.3.0 hooks: