Skip to content

Commit fe5df9f

Browse files
feature: add sourcemeta jsonschema linting to pre-commit
relates to #401
1 parent 39f8aa4 commit fe5df9f

File tree

6 files changed

+40
-5
lines changed

6 files changed

+40
-5
lines changed

.pre-commit-config.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,16 @@ repos:
9191
- --indent
9292
- "2"
9393
- --case-indent
94+
95+
- repo: https://github.com/sourcemeta/jsonschema
96+
rev: v7.3.0
97+
hooks:
98+
- id: sourcemeta-jsonschema-lint
99+
name: sourcemeta-jsonschema-lint
100+
files: ^schemas/
101+
# This is from json schema std so not touching it
102+
exclude: ^schemas/json-schema-draft-07.json
103+
args:
104+
- --disable
105+
- const_with_type
106+
types: [json]

package-lock.json

Lines changed: 25 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44
"@antora/cli": "3.1.7",
55
"@antora/lunr-extension": "1.0.0-alpha.8",
66
"@antora/site-generator": "3.1.7",
7-
"asciidoctor-kroki": "0.17.0",
87
"@asciidoctor/tabs": "v1.0.0-beta.6",
8+
"asciidoctor-kroki": "0.17.0",
99
"prettier": "3.4.2",
10+
"@sourcemeta/jsonschema": "7.2.3",
1011
"wavedrom-cli": "^3.1.1"
1112
}
1213
}

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)