Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
161 commits
Select commit Hold shift + click to select a range
d7faee3
relocate incoming files definition and rename attributesDesc to attri…
hayssams Oct 27, 2024
d186d72
Merge branch 'SchemaStore:master' into master
hayssams Nov 16, 2024
a0b7c00
remove Duration and add ability to have loader specified in the conne…
hayssams Nov 16, 2024
b1bec74
Merge branch 'SchemaStore:master' into master
hayssams Nov 28, 2024
8df33b7
Support connections specific to load and/or transforms
hayssams Nov 28, 2024
550eb8e
Merge branch 'SchemaStore:master' into master
hayssams Jan 14, 2025
2aa2f75
Improve expectations
hayssams Jan 14, 2025
9af7612
Merge branch 'SchemaStore:master' into master
hayssams Jan 16, 2025
0d01559
Update expectations in load section also
hayssams Jan 16, 2025
0dd1e05
Merge branch 'master' of github.com:starlake-ai/schemastore
hayssams Jan 16, 2025
63f66a5
Merge branch 'SchemaStore:master' into master
hayssams Jan 30, 2025
a146bb8
Code spell fix
hayssams Jan 30, 2025
67c9ac1
Merge branch 'master' of github.com:starlake-ai/schemastore
hayssams Jan 30, 2025
193ff1d
Merge branch 'SchemaStore:master' into master
hayssams Feb 7, 2025
3aaf130
Add DATAFRAME option
hayssams Feb 7, 2025
cb69f43
Merge branch 'master' of github.com:starlake-ai/schemastore
hayssams Feb 7, 2025
60a1857
Merge branch 'SchemaStore:master' into master
hayssams May 19, 2025
4b81e70
Add new attribute duckdbExtensions
hayssams May 19, 2025
6804da9
fix typo
hayssams May 19, 2025
3bd5359
apply prettier
hayssams May 19, 2025
f13f647
Merge branch 'SchemaStore:master' into master
hayssams Jul 31, 2025
33bd7ed
Add support for database sync
hayssams Jul 31, 2025
b8ec686
fix typo
hayssams Aug 28, 2025
d721371
Merge branch 'SchemaStore:master' into master
hayssams Oct 13, 2025
39ae73b
Add ability to externalize macros and types folders
hayssams Oct 13, 2025
4cabda4
add bento stream configuration file schema (#5293)
jem-davies Jan 20, 2026
de258fc
feat(renovate): add previous major versions' schemas + global self-ho…
jamietanna Jan 20, 2026
3e7c193
feat: add lefthook jsonc catalog file matches (#5295)
scop Jan 20, 2026
d61dd8d
feat: add Awesome Repositories schema (self-hosted) (#5296)
abordage Jan 20, 2026
e3c27e2
Add artifact-metadata property to github-workflow schema (#5292)
jsf9k Jan 20, 2026
b4d2735
Add `buf.lock` support (#5297)
stefanvanburen Jan 20, 2026
c508409
Update ty's JSON schema (#5299)
MichaReiser Jan 21, 2026
532c9c8
feat: add new properties and descriptions to Traefik v3 JSON schema a…
ReneNulschDE Jan 22, 2026
298b9d8
add pgxgen configuration file schema (#5303)
sxwebdev Jan 22, 2026
2d9cfaf
update dotnet download to cdn endpoint
leecow Jan 22, 2026
0c988ea
feat(rumdl): host schema locally for direct URL access
rvben Jan 22, 2026
943ff02
feat: specify type of array items
gian1200 Jan 23, 2026
17b1105
HTMLHint: specify type of array items (#5306)
hyperupcall Jan 23, 2026
38c1489
Merge pull request #5305 from rvben/add-rumdl-schema-file
hyperupcall Jan 23, 2026
bc3661e
Merge pull request #5304 from leecow/leecow_cdnupdate
hyperupcall Jan 23, 2026
abda61f
Update Claude Code settings schema with missing settings and fixes (#…
miteshashar Jan 23, 2026
992cf68
feat: add Hugo import version property
jgazeau Jan 23, 2026
0a640aa
add codex config.toml schema
sayan-oai Jan 23, 2026
efec175
Merge pull request #5308 from sayan-oai/add-codex-config
hyperupcall Jan 24, 2026
e04ff72
Merge pull request #5307 from jgazeau/feat/hugo-import-version
hyperupcall Jan 24, 2026
d9a66f4
Add editorconfig for web and packages .config (#5311)
Kissaki Jan 25, 2026
5354ba2
Introduce dark mode (#5313)
Kissaki Jan 25, 2026
d7785cd
Update Claude Code settings schema for v2.1.19 (#5314)
miteshashar Jan 25, 2026
a87b4ea
Replace API image with JSON Schema logo (#5317)
Kissaki Jan 26, 2026
3a73d65
Drop editorconfig EOL configuration (#5316)
Kissaki Jan 26, 2026
fb4cd37
Update kya.json (#5315)
WP-LKL Jan 26, 2026
a82a4bd
Improve sponsor image, fix dark scheme visual artifacts (#5318)
Kissaki Jan 26, 2026
0631285
add Espanso schemas (#5319)
rosidae Jan 26, 2026
78e1696
[pre-commit.ci] pre-commit autoupdate (#5320)
pre-commit-ci[bot] Jan 26, 2026
affba5a
feat(renovate): add "inherited" config (#5321)
jamietanna Jan 27, 2026
979bb17
Add Applicant Profile Protocol (APP) schema (#5322)
caglarorhan Jan 27, 2026
e1c0e82
Add AWS Amplify Console build schema (amplify.json), positive test, a…
Ktsierra Jan 30, 2026
71ecfd6
feat: add Renovate 42's JSON Schema (#5324)
jamietanna Jan 30, 2026
d54bcad
fix(tsconfig): Allow "module" Node20 (capital N) (#5326)
Tobbe Jan 30, 2026
7d7c0d1
Add OpenSRM (Open Service Reliability Manifest) schema (#5327)
rsionnach Jan 30, 2026
c28c44d
Replace octocat image png -> svg (#5329)
Kissaki Jan 31, 2026
426ee6e
Update Claude Code settings schema for v2.1.29
kanghyojun Feb 2, 2026
8e28509
Add hostPattern marketplace tests for Claude Code settings
kanghyojun Feb 2, 2026
77533a4
Format and refine Claude Code settings tests
kanghyojun Feb 2, 2026
2d99c68
youtrack-app. Add a new endpoint PROJECT_TAB (#5328)
maxmaximov Feb 2, 2026
65540d0
Add Claude Code Keybindings schema (#5325)
antrewmorrison Feb 2, 2026
9a66da1
Merge branch 'SchemaStore:master' into master
hayssams Feb 2, 2026
63bb1cf
Add dataset_triggering options and improve documentation
hayssams Feb 2, 2026
c8f4fe7
Merge branch 'features/custom-folders'
hayssams Feb 2, 2026
fa6fb81
update description
hayssams Feb 3, 2026
9959e4b
Fix typo
hayssams Feb 3, 2026
444f260
Merge pull request #5336 from starlake-ai/master
hyperupcall Feb 3, 2026
093af77
feat(rumdl): update schema to v0.1.10 (#5340)
rvben Feb 3, 2026
c284d54
Add pitcms schema (#5342)
yuto343 Feb 3, 2026
fae4696
Update ruff's JSON schema (#5343)
ntBre Feb 3, 2026
f3390fa
Add basedpyright schema
adiktofsugar Feb 2, 2026
404074f
Update vCluster config schema URL
johannesfrey Feb 4, 2026
16a0349
Add schema for `prek`
j178 Feb 4, 2026
e9f003d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 5, 2026
108f0c2
feat(rumdl): update schema to v0.1.13
github-actions[bot] Feb 5, 2026
f6abd52
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 5, 2026
53a5106
snowflake config: update authenticator variants and subsequent WIF au…
yanilov Feb 5, 2026
406a6a7
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 5, 2026
a73fabf
Update ty's JSON schema
charliermarsh Feb 5, 2026
b9a6e86
Merge pull request #5350 from astral-sh/update-ty-044af7fda21189c69a4…
hyperupcall Feb 5, 2026
cae71bb
Merge pull request #5348 from rvben/rumdl-schema-update
hyperupcall Feb 5, 2026
89d3f65
Merge pull request #5339 from adiktofsugar/master
hyperupcall Feb 5, 2026
fa49bd2
Merge pull request #5349 from yanilov/update_snowflake_authenticator_…
hyperupcall Feb 5, 2026
f17816b
Merge pull request #5345 from j178/prek
hyperupcall Feb 5, 2026
be0d8f0
Merge pull request #5332 from kanghyojun/claude-code-2129
hyperupcall Feb 5, 2026
f6e56f5
Merge pull request #5344 from johannesfrey/update-vcluster-url
hyperupcall Feb 5, 2026
1cce01b
Add bricks schema (#5351)
evheniyt Feb 6, 2026
072ee51
Add `auditLevel` to pnpm-workspace.json (#5352)
btea Feb 7, 2026
6947e22
feat(claude-code-settings): sync to Claude Code v2.1.29 (#5337)
miteshashar Feb 7, 2026
d86d3b7
Add missing octocat.svg
Kissaki Feb 8, 2026
45a3da6
Mail Servers Configuration
MagIlyasDOMA Feb 9, 2026
1cd48f2
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 9, 2026
13cacdf
chore(deps): update ctfd.json schema for ctfd-setup v1.8.4 (#5360)
ctfer-io-bot Feb 10, 2026
c6575d4
Update claude-code-settings.json: add TeammateIdle and TaskCompleted …
Johntycour Feb 11, 2026
e84364b
feat(claude-code-settings): sync to Claude Code v2.1.37 (#5354)
miteshashar Feb 11, 2026
7812f03
[claude-code-settings] Add missing tool names to permissionRule patte…
domdomegg Feb 11, 2026
e24defd
Merge pull request #5355 from MagIlyasDOMA/mail-servers-config
hyperupcall Feb 12, 2026
3e06a3e
Merge pull request #5353 from Kissaki/fix/octocat
hyperupcall Feb 14, 2026
8372b6f
Add ECA config json (#5356)
ericdallo Feb 14, 2026
bd9ad1f
Merge pull request #5358 from cjdcordeiro/patch-1
cjdcordeiro Feb 14, 2026
c5b8ed7
Added support for specmatic config v3 (#5362)
joelrosario Feb 14, 2026
c026d9d
Merge pull request #5364 from j178/prek
j178 Feb 14, 2026
7bd9236
fix(hatch): better support build hooks under tombi strict (#5365)
cennis91 Feb 14, 2026
b54b6c3
Merge pull request #5367 from djgoku/chore-switch-cirrus-yml-to-git-link
djgoku Feb 14, 2026
e7b21d1
Merge pull request #5369 from astral-sh/update-ty-8cec857182f4bc28bd8…
sharkdp Feb 14, 2026
b3b0f08
Merge pull request #5366 from rvben/rumdl-schema-update
rvben Feb 14, 2026
3dc12ed
Add version 10.0 of the AIO connector metadata schema (#5334)
timtay-microsoft Feb 14, 2026
ccf4f88
Update ruff's JSON schema (#5368)
ntBre Feb 14, 2026
de5b75e
Add JSON Schema for metadata.json, used by Docker Desktop extensions.…
KTrain5169 Feb 15, 2026
d6549a0
feat(claude-code-settings): sync to Claude Code v2.1.42 (#5371)
miteshashar Feb 15, 2026
a534dfc
feat(rumdl): update schema to v0.1.22 (#5372)
rvben Feb 16, 2026
9c361a8
Add oxfmt and oxlint (#5373)
pi0 Feb 17, 2026
40fd775
Update youtrack-app.json with conditional 'showHeader' (#5374)
andrey-skl Feb 17, 2026
bcd1cb0
feat(claude-code-settings): sync to Claude Code v2.1.47 (#5378)
miteshashar Feb 19, 2026
faf97f9
Update regex of poe.tasks (#5377)
kzrnm Feb 19, 2026
d6118d0
feature: 🐊Putout v42 (#5379)
coderaiser Feb 20, 2026
48a9985
Update timezone data using tzdb 2025c (#5380)
JamieMagee Feb 20, 2026
59f5a96
Update ruff's JSON schema (#5382)
ntBre Feb 20, 2026
d31a6bd
fix(schema):fixed linting issues in appsscript.json and asconfig-sche…
Vaibhav701161 Feb 20, 2026
638f7ee
schema: add Pantsbuild - 2.31.0 (#5387)
cburroughs Feb 20, 2026
7aee8ff
feat(rumdl): update schema to v0.1.24 (#5388)
rvben Feb 20, 2026
10f7f85
feat(claude-code-settings): add managed/enterprise settings fields (#…
ant-kurt Feb 20, 2026
0482aef
feat(claude-code-settings): improve test coverage (#5385)
miteshashar Feb 21, 2026
a607103
Add @ant-kurt as CODEOWNERS for claude-code-settings (#5390)
ant-kurt Feb 21, 2026
673a08e
Update ty's JSON schema (#5391)
carljm Feb 22, 2026
68b3844
Add BMML (Business Model Markup Language) schema (#5301)
hiasinho Feb 22, 2026
7611465
feat: add opt-in test coverage analysis tool (#5383)
miteshashar Feb 22, 2026
b7fea85
maturin: add FeatureSpec for features field (#5395)
trim21 Feb 23, 2026
3fea233
Update bamboo-spec's JSON schema (#5396)
HRAshton Feb 23, 2026
a10d372
fix(coverage): reduce false positives in negative test isolation chec…
miteshashar Feb 23, 2026
3d36601
Update pubspec schema to support workspace and null types (#5399)
luo2430 Feb 23, 2026
441fb5d
Update catalog.json for Upsun (#5400)
flovntp Feb 23, 2026
bf06571
Add new Serilog log-level "Off" (#5401)
tvardero Feb 23, 2026
292bebf
✨ feat(tox): add tox.toml JSON Schema to catalog (#5402)
gaborbernat Feb 23, 2026
93569d9
Issue #5403: Update MetricsHub connector json schema (#5404)
CherfaElyes Feb 23, 2026
130e05f
fix(schema): normalize volumes metadata and resolve linting issues in…
Vaibhav701161 Feb 23, 2026
f8e7c35
feat(schema): add Flatpak Builder manifest JSON schema (#5394)
Vaibhav701161 Feb 23, 2026
6a12029
feat(claude-code-settings): sync to Claude Code v2.1.50 (#5397)
miteshashar Feb 23, 2026
aa5d2bb
Add bg-dependency-aware-stop-order parameter (#5333)
vkalapov Feb 24, 2026
a222595
feat(rumdl): update schema to v0.1.28 (#5411)
rvben Feb 24, 2026
2c3e6be
feat: Add Docs MCP configuration schema (#5412)
ThomasRooney Feb 25, 2026
6ea6a7d
Update tox JSON Schema to 4.46.2 (#5414)
gaborbernat Feb 25, 2026
82a417d
Add Citrus test case schema (#5408)
apupier Feb 26, 2026
d2ca59d
Update ruff's JSON schema (#5415)
ntBre Feb 26, 2026
7f76b24
Add aio wasm graph schema 1.1.0 (#5416)
ancaantochi Feb 26, 2026
2977812
feat(dependabot-2.0): update schema to match current Dependabot featu…
JamieMagee Feb 27, 2026
83a4b6d
fix: update URLs from 4lando to lando-community (#5418)
AaronFeledy Feb 28, 2026
7d293c8
Add mockd.yaml schema (multi-protocol API mock server) (#5417)
zach-snell Feb 28, 2026
cb6983b
Upgrade appsettings.json schema to draft-07 (#5419)
scottaddie Feb 28, 2026
374575f
Add schema for JReleaser 1.23.0 (#5422)
aalmiray Feb 28, 2026
ffaf182
feat(claude-code-settings): sync to Claude Code v2.1.63 (#5421)
miteshashar Mar 1, 2026
d6bcb1e
Added schema for text2confl configuration file (#5423)
zeldigas Mar 2, 2026
56172df
Update tox JSON Schema to 4.47.0 (#5424)
gaborbernat Mar 2, 2026
435aafc
Add 3 more `FormatStyle` values for `.clang-tidy` (#5425)
NekkoDroid Mar 2, 2026
2687b13
Add missing options to Traefik v3 file provider schema (#5426)
mbelangergit Mar 2, 2026
d2cb890
Update ty's JSON schema (#5428)
charliermarsh Mar 2, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,18 @@ indent_size = 4

[*.sh]
indent_style = tab

[Web.config]
charset = utf-8
indent_style = space
indent_size = 4
insert_final_newline = true

[packages.config]
charset = utf-8-bom
indent_style = space
indent_size = 2
insert_final_newline = false

[.editorconfig]
charset = utf-8
25 changes: 19 additions & 6 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ src/test/circleciconfig/ @CircleCI-Public/developer-experience @meeech @gordonsy
src/negative_test/circleciconfig/ @CircleCI-Public/developer-experience @meeech @gordonsyme

# Managed by JetBrains YouTrack team
src/schemas/json/youtrack-app.json @skoch13 @andrey-skl @zmaks
src/test/youtrack-app/ @skoch13 @andrey-skl @zmaks
src/negative_test/youtrack-app/ @skoch13 @andrey-skl @zmaks
src/schemas/json/youtrack-app.json @skoch13 @andrey-skl @zmaks @maxmaximov
src/test/youtrack-app/ @skoch13 @andrey-skl @zmaks @maxmaximov
src/negative_test/youtrack-app/ @skoch13 @andrey-skl @zmaks @maxmaximov

# Managed by Vector Informatik canoe-ci-tools team
src/schemas/json/venvironment-* @vectorgrp/canoe-ci-tools @raphael-grimm @JoergSrj @VCecileKefelian
Expand Down Expand Up @@ -62,9 +62,12 @@ src/test/powerpages.config/ @priyanshu92 @ashishchoudhary001 @amitjoshi438 @tyag
src/negative_test/powerpages.config/ @priyanshu92 @ashishchoudhary001 @amitjoshi438 @tyaginidhi

# Managed by Anthropic Team:
src/schemas/json/claude-code-settings.json @domdomegg @bogini
src/test/claude-code-settings/ @domdomegg @bogini
src/negative_test/claude-code-settings/ @domdomegg @bogini
src/schemas/json/claude-code-settings.json @domdomegg @bogini @ant-kurt
src/test/claude-code-settings/ @domdomegg @bogini @ant-kurt
src/negative_test/claude-code-settings/ @domdomegg @bogini @ant-kurt
src/schemas/json/claude-code-keybindings.json @domdomegg @bogini @antrewmorrison
src/test/claude-code-keybindings/ @domdomegg @bogini @antrewmorrison
src/negative_test/claude-code-keybindings/ @domdomegg @bogini @antrewmorrison

# Managed by Convex Team:
src/schemas/json/convex.json @ianmacartney @thomasballinger @Nicolapps
Expand All @@ -75,3 +78,13 @@ src/negative_test/convex/ @ianmacartney @thomasballinger @Nicolapps
src/schemas/json/popxf-* @peterstangl @alekssmolkovic @kenmimasu
src/test/popxf-* @peterstangl @alekssmolkovic @kenmimasu
src/negative_test/popxf-* @peterstangl @alekssmolkovic @kenmimasu

# Managed by Open-KYA Team:
src/schemas/json/kya.json @wp-lkl
src/test/kya/ @wp-lkl
src/negative_test/kya/ @wp-lkl

# Managed by Specmatic team:
src/schemas/json/specmatic.json @joelrosario @nashjain
src/test/specmatic/ @joelrosario @nashjain
src/negative_test/specmatic/ @joelrosario @nashjain
1 change: 1 addition & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ jobs:
- run: 'npm run typecheck'
- run: 'npm run eslint'
- run: 'node ./cli.js check'
- run: 'node ./cli.js coverage'
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
repos:
- repo: 'https://github.com/rbubley/mirrors-prettier'
rev: 'v3.7.4'
rev: 'v3.8.1'
hooks:
- id: 'prettier'
types: [text]
Expand All @@ -25,5 +25,5 @@ repos:
args:
[
'--ignore-words-list',
'crate,ninjs,ans,specif,seh,specifid,deriver,isnt,tye,forin,dependees,rouge,interm,fo,wast,nome,statics,ue,aack,gost,inout,provId,handels,bu,testng,ags,edn,aks,te,decorder,provid,branche,alse,nd,mape,wil,clude,wit,flate,omlet,THIRDPARTY,NotIn,notIn,CopyIn,Requestor,requestor,re-use,ofo,abl,dout,foto,vor,wel,NAM,BRIN,everyTime,afterAll,beforeAll',
'crate,ninjs,ans,specif,seh,specifid,deriver,isnt,tye,forin,dependees,rouge,interm,fo,wast,nome,statics,ue,aack,gost,inout,provId,handels,bu,testng,ags,edn,aks,te,decorder,provid,branche,alse,nd,mape,wil,clude,wit,flate,omlet,THIRDPARTY,NotIn,notIn,CopyIn,Requestor,requestor,re-use,ofo,abl,dout,foto,vor,wel,NAM,BRIN,everyTime,afterAll,beforeAll,ontainer',
]
34 changes: 34 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
- [How to add a `$ref` to a JSON Schema that's hosted in this repository](#how-to-add-a-ref-to-a-json-schema-thats-hosted-in-this-repository)
- [How to add a `$ref` to a JSON Schema that's self-hosted](#how-to-add-a-ref-to-a-json-schema-thats-self-hosted)
- [How to validate a JSON Schema](#how-to-validate-a-json-schema)
- [How to check test coverage for a JSON Schema](#how-to-check-test-coverage-for-a-json-schema)
- [How to ignore validation errors in a JSON Schema](#how-to-ignore-validation-errors-in-a-json-schema)
- [How to name schemas that are subschemas (`partial-`)](#how-to-name-schemas-that-are-subschemas-partial-)
- [Older Links](#older-links)
Expand Down Expand Up @@ -670,6 +671,39 @@ For example, to validate the [`ava.json`](https://github.com/SchemaStore/schemas

Note that `<schemaName.json>` refers to the _filename_ that the schema has under `src/schemas/json`.

### How to check test coverage for a JSON Schema

The coverage tool analyzes how thoroughly your schema's test files exercise its constraints. It runs 8 checks:

1. **Unused `$defs`** — flags `$defs`/`definitions` entries not referenced by any `$ref`
2. **Description coverage** — flags properties missing a `description`
3. **Test completeness** — checks that every top-level schema property appears in at least one positive test
4. **Enum coverage** — checks that each enum value has positive test coverage and at least one invalid value in negative tests
5. **Pattern coverage** — checks that each `pattern` constraint has a matching and a violating test value
6. **Required field coverage** — checks that negative tests omit required fields
7. **Default value coverage** — checks that positive tests include non-default values
8. **Negative test isolation** — flags negative test files that test multiple unrelated violation types

**Opting in:** Add your schema to the `coverage` array in `src/schema-validation.jsonc`:

```jsonc
"coverage": [
{ "schema": "my-schema.json" },
{ "schema": "my-strict-schema.json", "strict": true }
]
```

- `strict` (default: `false`) — when `true`, coverage failures cause a non-zero exit code, enforced in CI.
- Without `strict: true`, the tool reports findings but does not fail CI.

**Running locally:**

```console
node ./cli.js coverage --schema-name=my-schema.json
```

Coverage is opt-in and runs in CI. Schemas with `strict: true` will block PRs on coverage failures. Schemas without `strict` get an advisory report only.

### How to ignore validation errors in a JSON Schema

> **Note**
Expand Down
125 changes: 125 additions & 0 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,17 @@ import jsonlint from '@prantlf/jsonlint'
import * as jsoncParser from 'jsonc-parser'
import ora from 'ora'
import chalk from 'chalk'
import {
checkUnusedDefs,
checkDescriptionCoverage,
checkTestCompleteness,
checkEnumCoverage,
checkPatternCoverage,
checkRequiredCoverage,
checkDefaultCoverage,
checkNegativeIsolation,
printCoverageReport,
} from './src/helpers/coverage.js'
import minimist from 'minimist'
import fetch, { FetchError } from 'node-fetch'
import { execFile } from 'node:child_process'
Expand Down Expand Up @@ -144,6 +155,7 @@ if (argv.SchemaName) {
* @property {string[]} highSchemaVersion
* @property {string[]} missingCatalogUrl
* @property {string[]} skiptest
* @property {{schema: string, strict?: boolean}[]} coverage
* @property {string[]} catalogEntryNoLintNameOrDescription
* @property {Record<string, SchemaValidationJsonOption>} options
*/
Expand Down Expand Up @@ -1481,6 +1493,10 @@ async function assertSchemaValidationJsonReferencesNoNonexistentFiles() {
schemaNamesMustExist(SchemaValidation.skiptest, 'skiptest')
schemaNamesMustExist(SchemaValidation.missingCatalogUrl, 'missingCatalogUrl')
schemaNamesMustExist(SchemaValidation.highSchemaVersion, 'highSchemaVersion')
schemaNamesMustExist(
(SchemaValidation.coverage ?? []).map((c) => c.schema),
'coverage',
)
for (const schemaName in SchemaValidation.options) {
if (!SchemasToBeTested.includes(schemaName)) {
printErrorAndExit(new Error(), [
Expand Down Expand Up @@ -2060,6 +2076,7 @@ TASKS:
check-remote: Run all build checks for remote schemas
maintenance: Run maintenance checks
build-xregistry: Build the xRegistry from the catalog.json
coverage: Run test coverage analysis on opted-in schemas

EXAMPLES:
node ./cli.js check
Expand Down Expand Up @@ -2132,6 +2149,113 @@ EXAMPLES:
}
}

// ---------------------------------------------------------------------------
// Coverage task
// ---------------------------------------------------------------------------

async function taskCoverage() {
const coverageSchemas = SchemaValidation.coverage ?? []
if (coverageSchemas.length === 0) {
console.info(
'No schemas opted into coverage. Add schemas to "coverage" in schema-validation.jsonc',
)
return
}

const spinner = ora()
spinner.start()
let hasFailure = false
let hasMatch = false

for (const entry of coverageSchemas) {
const schemaName = entry.schema
const strict = entry.strict ?? false
if (argv['schema-name'] && argv['schema-name'] !== schemaName) {
continue
}
hasMatch = true

const schemaId = schemaName.replace('.json', '')
spinner.text = `Running coverage checks on "${schemaName}"${strict ? ' (strict)' : ''}`

// Load schema
const schemaFile = await toFile(path.join(SchemaDir, schemaName))
const schema = /** @type {Record<string, unknown>} */ (schemaFile.json)

// Load positive test files
const positiveTests = new Map()
const posDir = path.join(TestPositiveDir, schemaId)
for (const testfile of await fs.readdir(posDir).catch(() => [])) {
if (isIgnoredFile(testfile)) continue
const file = await toFile(path.join(posDir, testfile))
positiveTests.set(testfile, file.json)
}

// Load negative test files
const negativeTests = new Map()
const negDir = path.join(TestNegativeDir, schemaId)
for (const testfile of await fs.readdir(negDir).catch(() => [])) {
if (isIgnoredFile(testfile)) continue
const file = await toFile(path.join(negDir, testfile))
negativeTests.set(testfile, file.json)
}

// Run all 8 checks
const results = [
{ name: '1. Unused $defs', result: checkUnusedDefs(schema) },
{
name: '2. Description Coverage',
result: checkDescriptionCoverage(schema),
},
{
name: '3. Test Completeness',
result: checkTestCompleteness(schema, positiveTests),
},
{
name: '4. Enum Coverage',
result: checkEnumCoverage(schema, positiveTests, negativeTests),
},
{
name: '5. Pattern Coverage',
result: checkPatternCoverage(schema, positiveTests, negativeTests),
},
{
name: '6. Required Field Coverage',
result: checkRequiredCoverage(schema, negativeTests),
},
{
name: '7. Default Value Coverage',
result: checkDefaultCoverage(schema, positiveTests),
},
{
name: '8. Negative Test Isolation',
result: checkNegativeIsolation(schema, negativeTests),
},
]

spinner.stop()
printCoverageReport(schemaName, results)
if (strict && results.some((r) => r.result.status === 'fail'))
hasFailure = true

// Restart spinner for next schema
if (coverageSchemas.indexOf(entry) < coverageSchemas.length - 1) {
spinner.start()
}
}

if (!hasMatch) {
spinner.stop()
printErrorAndExit(null, [
`Schema "${argv['schema-name']}" is not in the coverage list in "${SchemaValidationFile}"`,
])
}

if (hasFailure) {
process.exit(1)
}
}

/** @type {Record<string, () => Promise<unknown>>} */
const taskMap = {
'new-schema': taskNewSchema,
Expand All @@ -2143,6 +2267,7 @@ EXAMPLES:
maintenance: taskMaintenance,
'build-website': taskBuildWebsite,
'build-xregistry': taskBuildXRegistry,
coverage: taskCoverage,
build: taskCheck, // Undocumented alias.
}
const taskOrFn = argv._[0]
Expand Down
3 changes: 2 additions & 1 deletion src/_Layout.cshtml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<!DOCTYPE html>
<!DOCTYPE html>
<html>
<head prefix="og: http://ogp.me/ns#">
<title>@Page.Title</title>

<meta charset="utf-8" />
<meta name="description" content="@Page.Description" />
<meta name="viewport" content="initial-scale=1.0" />
<meta name="color-scheme" content="light dark" />

<link href="/css/site.css" rel="stylesheet" />

Expand Down
Loading