From 27d41093eac43d2654bda137c181f2c57b692c8b Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Thu, 6 Jan 2022 13:57:37 +0100 Subject: [PATCH] Rename canonical-schema to canonical-data.schema.json Closes https://github.com/exercism/problem-specifications/issues/700 --- .github/workflows/ci.yml | 8 ++++---- README.md | 6 +++--- canonical-schema.json => canonical-data.schema.json | 0 exercises/linked-list/canonical-data.json | 4 ++-- package.json | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) rename canonical-schema.json => canonical-data.schema.json (100%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3c9bbcacde..86793d9111 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -62,7 +62,7 @@ jobs: - name: Install dependencies run: yarn install - - name: Verify that canonical-data.json files adhere to canonical-schema.json + - name: Verify that canonical-data.json files adhere to their json schema run: yarn test - name: Verify that all UUIDs are indeed unique @@ -100,16 +100,16 @@ jobs: - name: Verify that all scenarios are defined in the schema run: | - canonical_schema_file="canonical-schema.json" + canonical_data_schema_file="canonical-data.schema.json" scenarios_file="SCENARIOS.txt" fail=0 while read -r scenario; do - jq -e ".definitions.scenario.enum | index(\"$scenario\")" $canonical_schema_file > /dev/null + jq -e ".definitions.scenario.enum | index(\"$scenario\")" $canonical_data_schema_file > /dev/null if [ $? -eq 1 ]; then - echo "$canonical_schema_file: scenario '$scenario' is missing from the '.definitions.scenario.enum' field." + echo "$canonical_data_schema_file: scenario '$scenario' is missing from the '.definitions.scenario.enum' field." fail=1 fi done < $scenarios_file diff --git a/README.md b/README.md index 36d9eca926..821346a6de 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ Test data can be incorporated into a track's test suites manually or extracted b ## Test Data Format -The file format is described in [canonical-schema.json](./canonical-schema.json), but it is easier to understand with an example: +The file format is described in [canonical-data.schema.json](./canonical-data.schema.json), but it is easier to understand with an example: ```json { @@ -254,7 +254,7 @@ There are also some conventions that must be followed: ```json { -"$schema": "https://github.com/exercism/problem-specifications/blob/main/canonical-schema.json" + "$schema": "https://github.com/exercism/problem-specifications/blob/main/canonical-data.schema.json" } ``` @@ -267,7 +267,7 @@ When creating a new exercise the design team needs to be informed so that a new ## Automated Tests -`canonical-data.json` for each exercise is checked for compliance against the [canonical-schema.json](canonical-schema.json). +`canonical-data.json` for each exercise is checked for compliance against the [canonical-data.schema.json](canonical-data.schema.json). In order to run these tests, you will need to have `yarn` installed on your system. Install them from [here](https://yarnpkg.com/en/docs/install). diff --git a/canonical-schema.json b/canonical-data.schema.json similarity index 100% rename from canonical-schema.json rename to canonical-data.schema.json diff --git a/exercises/linked-list/canonical-data.json b/exercises/linked-list/canonical-data.json index f0d9d9327a..f2aca311ca 100644 --- a/exercises/linked-list/canonical-data.json +++ b/exercises/linked-list/canonical-data.json @@ -1,8 +1,8 @@ { "exercise": "linked-list", "comments": [ - "In order to keep the interface for the exercise close or equal to the ", - "description.md and also satisfying the canonical-schema.json, the only ", + "In order to keep the interface for the exercise close or equal to the ", + "description.md and also satisfying the canonical-data schema, the only ", "properties are pop, push, shift, unshift. Some tracks also implement ", "delete and count, via Track-Inserted hints. ", " ", diff --git a/package.json b/package.json index 874717ca9b..e88f674204 100644 --- a/package.json +++ b/package.json @@ -10,8 +10,8 @@ "ajv-cli": "^3.3.0" }, "scripts": { - "test": "ajv -s canonical-schema.json -d \"exercises/*/canonical-data.json\"", - "test-one": "ajv -s canonical-schema.json -d" + "test": "ajv -s canonical-data.schema.json -d \"exercises/*/canonical-data.json\"", + "test-one": "ajv -s canonical-data.schema.json -d" }, "resolutions": { "minimist": "^1.2.3"