Skip to content

Commit

Permalink
Bump meta-schema version of input format schema to draft 2020-12 (#54)
Browse files Browse the repository at this point in the history
Also add a tox environment to check the input format schema files
(in schemas/) and the input format instance files (in
tests/resources/).
  • Loading branch information
akosthekiss authored Dec 20, 2024
1 parent 3716169 commit e2dadf4
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
14 changes: 13 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion schemas/format.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion schemas/replacements.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
10 changes: 9 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py, lint, build
envlist = py, lint, schema, build
isolated_build = true

[testenv]
Expand All @@ -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
Expand Down

0 comments on commit e2dadf4

Please sign in to comment.