From e2dadf4885b917e8dfe19f7aee21f593f5a81ef9 Mon Sep 17 00:00:00 2001 From: Akos Kiss Date: Fri, 20 Dec 2024 09:50:04 +0100 Subject: [PATCH] Bump meta-schema version of input format schema to draft 2020-12 (#54) Also add a tox environment to check the input format schema files (in schemas/) and the input format instance files (in tests/resources/). --- .github/workflows/main.yml | 14 +++++++++++++- schemas/format.json | 2 +- schemas/replacements.json | 2 +- tox.ini | 10 +++++++++- 4 files changed, 24 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5867b2c..90aed70 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -35,6 +35,18 @@ jobs: - run: pip install --upgrade tox - run: tox -v -e lint + schema: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: actions/setup-python@v5 + with: + python-version: '3.x' + - run: pip install --upgrade tox + - run: tox -v -e schema + cov: runs-on: ubuntu-latest steps: @@ -51,7 +63,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} publish: - needs: [test, lint] + needs: [test, lint, schema] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/schemas/format.json b/schemas/format.json index be1fdb0..3d2bb2b 100644 --- a/schemas/format.json +++ b/schemas/format.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-06/schema#", + "$schema": "https://json-schema.org/draft/2020-12/schema", "description": "Picireny input format definition.", "type": "object", diff --git a/schemas/replacements.json b/schemas/replacements.json index 850b92b..35ed1f4 100644 --- a/schemas/replacements.json +++ b/schemas/replacements.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-06/schema#", + "$schema": "https://json-schema.org/draft/2020-12/schema", "description": "Replacement strings mapped to grammar token names.", "type": "object", diff --git a/tox.ini b/tox.ini index 925f84f..0b42c80 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py, lint, build +envlist = py, lint, schema, build isolated_build = true [testenv] @@ -25,6 +25,14 @@ commands = pylint src/picireny tests pycodestyle src/picireny tests --ignore=E501 --exclude=src/picireny/antlr4/parser/ANTLRv4*.py +[testenv:schema] +deps = + check-jsonschema +skip_install = true +commands = + check-jsonschema -v --check-metaschema schemas/format.json schemas/replacements.json + check-jsonschema -v --schemafile schemas/format.json tests/resources/inijson.json tests/resources/inijson-crlf.json + [testenv:build] deps = build