Skip to content

Commit c6fee7d

Browse files
feature: add sourcemeta jsonschema linting to pre-commit
relates to #401
1 parent d51cb12 commit c6fee7d

File tree

7 files changed

+15
-5
lines changed

7 files changed

+15
-5
lines changed

.devcontainer/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,6 @@ RUN apt-get install -y --no-install-recommends git \
3030
RUN apt-get clean autoclean
3131
RUN apt-get autoremove -y
3232
RUN rm -rf /var/lib/{apt,dpkg,cache,log}/*
33+
RUN npm install @sourcemeta/jsonschema
3334

3435
WORKDIR /workspace

.pre-commit-config.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,18 @@ repos:
8282
language: system
8383
entry: shellcheck
8484
args: ["--severity=error"]
85+
- id: sourcemeta-jsonschema-lint
86+
name: sourcemeta-jsonschema-lint
87+
files: ^schemas/
88+
# This is from json schema std so not touching it
89+
exclude: ^schemas/json-schema-draft-07.json
90+
args:
91+
- --disable
92+
- const_with_type
93+
# Below goes away once hook isn't local
94+
language: system
95+
types: [json]
96+
entry: jsonschema lint
8597

8698
- repo: https://github.com/scop/pre-commit-shfmt
8799
rev: v3.11.0-1

bin/.container-tag

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.6
1+
0.7

container.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,4 @@ From: ubuntu:24.04
4646

4747
# npm i wavedrom-cli
4848
# npm i i -E @antora/[email protected] @antora/[email protected] @antora/lunr-extension asciidoctor-kroki
49+
npm install @sourcemeta/jsonschema

schemas/cert_class_schema.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
"description": "Descriptive name of the class"
2424
},
2525
"processor_kind": {
26-
"type": "string",
2726
"enum": ["Generic Unprivileged", "Microcontroller", "Apps Processor"],
2827
"description": "What kind of class is this?"
2928
},
@@ -34,7 +33,6 @@
3433
"mandatory_priv_modes": {
3534
"type": "array",
3635
"items": {
37-
"type": "string",
3836
"enum": ["M", "S", "U", "VS", "VU"]
3937
},
4038
"uniqueItems": true,

schemas/cert_model_schema.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@
9696
"description": "List of semantic versions within the model"
9797
},
9898
"base": {
99-
"type": "integer",
10099
"enum": [32, 64],
101100
"description": "Base of the model"
102101
},

schemas/profile_class_schema.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
"const": "profile class"
1414
},
1515
"processor_kind": {
16-
"type": "string",
1716
"enum": ["Generic Unprivileged", "Microcontroller", "Apps Processor"],
1817
"description": "What kind of class is this?"
1918
},

0 commit comments

Comments
 (0)