From 428ec8d833f4459a5b82f194d39d994f0e3d3d66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Wed, 5 Apr 2023 08:43:24 +0200 Subject: [PATCH] Use the pre-commit hook from jsonschema2md2 --- .pre-commit-config.yaml | 16 ++++++++++++++++ Makefile | 7 ------- poetry.lock | 18 +----------------- pyproject.toml | 1 - 4 files changed, 17 insertions(+), 25 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 88606e32d..b06774385 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,6 +8,7 @@ ci: - helm-lock - ripsecrets - jsonschema-gentypes + - jsonschema2md repos: - repo: https://github.com/pre-commit/mirrors-prettier @@ -38,6 +39,21 @@ repos: ĵsonschema-gentypes.yaml$ |^c2cciutils/schema.*\.json$ ) + - repo: https://github.com/sbrunner/jsonschema2md2 + rev: 0.6.0 + hooks: + - id: jsonschema2md + files: c2cciutils/schema.json + args: + - --pre-commit + - c2cciutils/schema.json + - config.md + - id: jsonschema2md + files: c2cciutils/schema-applications.json + args: + - --pre-commit + - c2cciutils/schema-applications.json + - applications.md - repo: https://github.com/sbrunner/hooks rev: 0.5.0 hooks: diff --git a/Makefile b/Makefile index 85aa27475..ed0a4e5bc 100644 --- a/Makefile +++ b/Makefile @@ -24,10 +24,3 @@ checks: prospector ## Do the checks .PHONY: prospector prospector: build-checker ## Run Prospector docker run --rm --volume=${PWD}:/app $(GITHUB_REPOSITORY)-checker prospector --ignore-paths=example-project/ --output=pylint --die-on-tool-error - -.PHONY: jsonschema -jsonschema: ## Generate files depends on the JSON schema - jsonschema-gentypes - jsonschema2md c2cciutils/schema.json config.md - jsonschema2md c2cciutils/schema-applications.json applications.md - c2cciutils-checks --fix --check=prettier diff --git a/poetry.lock b/poetry.lock index 118b54e83..f5d28700a 100644 --- a/poetry.lock +++ b/poetry.lock @@ -531,18 +531,6 @@ typing-extensions = "*" extra = ["pinyin", "romanize", "romkan"] tools = ["black", "isort", "pyupgrade"] -[[package]] -name = "jsonschema2md2" -version = "0.6.0" -description = "Convert JSON Schema to human-readable Markdown documentation" -category = "dev" -optional = false -python-versions = ">=3.6,<4.0" - -[package.dependencies] -click = ">=7" -PyYAML = ">=5.1" - [[package]] name = "keyring" version = "23.13.1" @@ -1450,7 +1438,7 @@ publish_plugins = [] [metadata] lock-version = "1.1" python-versions = ">=3.8,<4.0" -content-hash = "0d46cb4ff3611be62ffdb581c746ced52eeff58b27db5c23ab9534ef82f5f198" +content-hash = "2c0eb44e8f4a50d4a457dc5ba450049b6e0e5aeed603bc7736e1fe9296b69968" [metadata.files] astroid = [ @@ -1792,10 +1780,6 @@ jsonschema-gentypes = [ {file = "jsonschema_gentypes-1.5.0-py3-none-any.whl", hash = "sha256:4cb769bfd206610fe2b673daab015cf7c3df0dfddf903dba332a08b691469426"}, {file = "jsonschema_gentypes-1.5.0.tar.gz", hash = "sha256:6d53f22ea850023ca3af60b9a9425f2c75bb83faffa5463e18e78c1c1a6c7a0c"}, ] -jsonschema2md2 = [ - {file = "jsonschema2md2-0.6.0-py3-none-any.whl", hash = "sha256:d71fe2c8418a93821597bfe151636e25eccedc41afa29e9ca875951f4966e451"}, - {file = "jsonschema2md2-0.6.0.tar.gz", hash = "sha256:9c397bf3977290267dde4293e88f33feee41f90d9f77c61857447be7ce16d15b"}, -] keyring = [ {file = "keyring-23.13.1-py3-none-any.whl", hash = "sha256:771ed2a91909389ed6148631de678f82ddc73737d85a927f382a8a1b157898cd"}, {file = "keyring-23.13.1.tar.gz", hash = "sha256:ba2e15a9b35e21908d0aaf4e0a47acc52d6ae33444df0da2b49d41a46ef6d678"}, diff --git a/pyproject.toml b/pyproject.toml index 2868f0666..3d344b525 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -121,7 +121,6 @@ types-setuptools = "67.6.0.6" types-markdown = "3.4.2.6" types-toml = "0.10.8.6" typing-extensions = "4.5.0" -jsonschema2md2 = "0.6.0" [build-system] requires = [