From d346802ef9b61fbb8c0b228b6a5f86aefed06bf2 Mon Sep 17 00:00:00 2001 From: Marco Enrico Piras Date: Wed, 30 Oct 2024 17:25:39 +0100 Subject: [PATCH 1/3] refactor(core): :recycle: rename the property to indicate the validator version in the JSON output --- rocrate_validator/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rocrate_validator/models.py b/rocrate_validator/models.py index 42387339..5b660eff 100644 --- a/rocrate_validator/models.py +++ b/rocrate_validator/models.py @@ -1226,7 +1226,7 @@ def to_dict(self) -> dict: "issues": [issue.to_dict() for issue in self.issues] } # add validator version to the settings - result["validation_settings"]["rocrate-validator-version"] = __version__ + result["validation_settings"]["rocrate_validator_version"] = __version__ return result def to_json(self, path: Optional[Path] = None) -> str: From e079f8f4ba776ce7061498029923bbd980609c99 Mon Sep 17 00:00:00 2001 From: Marco Enrico Piras Date: Wed, 30 Oct 2024 17:26:05 +0100 Subject: [PATCH 2/3] feat(core): :zap: add property to denote the format of the JSON output --- rocrate_validator/constants.py | 3 +++ rocrate_validator/models.py | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/rocrate_validator/constants.py b/rocrate_validator/constants.py index 0051afe8..83b39d79 100644 --- a/rocrate_validator/constants.py +++ b/rocrate_validator/constants.py @@ -82,3 +82,6 @@ 'MAY', 'OPTIONAL', 'SHOULD', 'SHOULD_NOT', 'REQUIRED', 'MUST', 'MUST_NOT', 'SHALL', 'SHALL_NOT', 'RECOMMENDED' ] + +# Current JSON output format +JSON_OUTPUT_FORMAT_VERSION = "0.1" diff --git a/rocrate_validator/models.py b/rocrate_validator/models.py index 5b660eff..74714a92 100644 --- a/rocrate_validator/models.py +++ b/rocrate_validator/models.py @@ -33,7 +33,8 @@ from rocrate_validator.constants import (DEFAULT_ONTOLOGY_FILE, DEFAULT_PROFILE_IDENTIFIER, DEFAULT_PROFILE_README_FILE, - IGNORED_PROFILE_DIRECTORIES, PROF_NS, + IGNORED_PROFILE_DIRECTORIES, + JSON_OUTPUT_FORMAT_VERSION, PROF_NS, PROFILE_FILE_EXTENSIONS, PROFILE_SPECIFICATION_FILE, RDF_SERIALIZATION_FORMATS_TYPES, @@ -1220,6 +1221,9 @@ def __eq__(self, other: object) -> bool: def to_dict(self) -> dict: allowed_properties = ["profile_identifier", "inherit_profiles", "requirement_severity", "abort_on_first"] result = { + "meta": { + "version": JSON_OUTPUT_FORMAT_VERSION + }, "validation_settings": {key: self.validation_settings[key] for key in allowed_properties if key in self.validation_settings}, "passed": self.passed(self.context.settings["requirement_severity"]), From 7251b5091821882dab88ba84c38b245c42a45716 Mon Sep 17 00:00:00 2001 From: Marco Enrico Piras Date: Wed, 30 Oct 2024 17:40:12 +0100 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=94=96=20bump=20version=20number=20to?= =?UTF-8?q?=200.4.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index a09614e2..32a9c27e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "roc-validator" -version = "0.4.1" +version = "0.4.2" description = "A Python package to validate RO-Crates" authors = [ "Marco Enrico Piras ",