Skip to content

Commit e72bfb6

Browse files
authored
Merge pull request #62 from ssciwr/ocrd-tool
Add ocrd-tool validation
2 parents 2a25f14 + 9650bd5 commit e72bfb6

File tree

4 files changed

+16
-2
lines changed

4 files changed

+16
-2
lines changed

.pre-commit-config.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,10 @@ repos:
9696
hooks:
9797
- id: check-readthedocs # Validate the given .readthedocs.yml file
9898
- id: check-dependabot # Validate the given dependabot.yml file
99+
- id: check-jsonschema
100+
args:
101+
- --schemafile=https://raw.githubusercontent.com/OCR-D/core/refs/heads/master/src/ocrd_validators/ocrd_tool.schema.yml
102+
files: ocrd-tool.json
99103

100104
ci:
101105
skip: [bump-precommit-and-identify]

precommend/.pre-commit-config.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,10 @@ repos:
9696
hooks:
9797
- id: check-readthedocs # Validate the given .readthedocs.yml file
9898
- id: check-dependabot # Validate the given dependabot.yml file
99+
- id: check-jsonschema
100+
args:
101+
- --schemafile=https://raw.githubusercontent.com/OCR-D/core/refs/heads/master/src/ocrd_validators/ocrd_tool.schema.yml
102+
files: ocrd-tool.json
99103

100104
ci:
101105
skip: [bump-precommit-and-identify]

precommend/rules.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,3 +138,9 @@ def validate_cff(ctx):
138138
def validate_pyproject(ctx):
139139
if ctx.filename_exists("pyproject.toml"):
140140
return "validate-pyproject"
141+
142+
143+
@rule
144+
def validate_ocrd_tool(ctx):
145+
if ctx.filename_exists("ocrd-tool.json"):
146+
return "validate-ocrd-tool"

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ classifiers = [
2828
]
2929
dependencies = [
3030
"click",
31-
"identify >= 2.6.14",
32-
"pre-commit >= 4.3.0",
31+
"identify >= 2.6.15",
32+
"pre-commit >= 4.5.0",
3333
"ruamel.yaml",
3434
]
3535

0 commit comments

Comments
 (0)