From 360d840fc9d4cce5431e2efa1610ce02bf309172 Mon Sep 17 00:00:00 2001 From: John Pennycook Date: Mon, 5 Feb 2024 08:51:54 -0800 Subject: [PATCH] Update coverage schema to 0.2.0 The new schema allows for coverage files to contain both a file hash and (optional) path information. Signed-off-by: John Pennycook --- MANIFEST.in | 2 +- .../schema/{coverage-0.1.0.schema => coverage-0.2.0.schema} | 5 ++++- codebasin/util.py | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) rename codebasin/schema/{coverage-0.1.0.schema => coverage-0.2.0.schema} (89%) diff --git a/MANIFEST.in b/MANIFEST.in index a6c7123..7f8230d 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,4 +1,4 @@ include codebasin/schema/compilation-database.schema include codebasin/schema/config.schema -include codebasin/schema/coverage-0.1.0.schema +include codebasin/schema/coverage-0.2.0.schema include codebasin/schema/importcfg.schema diff --git a/codebasin/schema/coverage-0.1.0.schema b/codebasin/schema/coverage-0.2.0.schema similarity index 89% rename from codebasin/schema/coverage-0.1.0.schema rename to codebasin/schema/coverage-0.2.0.schema index 6eccb1e..b0d6266 100644 --- a/codebasin/schema/coverage-0.1.0.schema +++ b/codebasin/schema/coverage-0.2.0.schema @@ -1,6 +1,6 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://raw.githubusercontent.com/intel/p3-analysis-library/main/p3/data/coverage-0.1.0.schema", + "$id": "https://raw.githubusercontent.com/intel/p3-analysis-library/main/p3/data/coverage-0.2.0.schema", "title": "Coverage", "description": "Lines of code used in each file of a code base.", "type": "array", @@ -10,6 +10,9 @@ "file": { "type": "string" }, + "path": { + "type": "string" + }, "regions": { "type": "array", "items": { diff --git a/codebasin/util.py b/codebasin/util.py index 8d31b39..a8394a2 100644 --- a/codebasin/util.py +++ b/codebasin/util.py @@ -141,7 +141,7 @@ def _validate_json(json_object: object, schema_name: str) -> bool: schema_paths = { "compiledb": "schema/compilation-database.schema", "config": "schema/config.schema", - "coverage": "schema/coverage-0.1.0.schema", + "coverage": "schema/coverage-0.2.0.schema", "importcfg": "schema/importcfg.schema", } if schema_name not in schema_paths.keys():