feat: enhance JSON output for multi-profile validation#74
Merged
kikkomep merged 8 commits intocrs4:developfrom Mar 7, 2025
Merged
Conversation
Member
|
I tried the following and got an error: $ rocrate-validator -y validate -v -f json -o err.json -l REQUIRED tests/data/crates/valid/multi-profile-crate/
This error may be due to a bug.
Please report it to the issue tracker along with the following stack trace:
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /home/simleo/git/rocrate-validator/rocrate_validator/cli/commands/validate.py:439 in validate │
│ │
│ 436 │ │ │ # Print the validation report to a file │
│ 437 │ │ │ if output_file: │
│ 438 │ │ │ │ with open(output_file, "w") as f: │
│ ❱ 439 │ │ │ │ │ f.write(json_output) │
│ 440 │ │ │
│ 441 │ │ # using ctx.exit seems to raise an Exception that gets caught below, │
│ 442 │ │ # so we use sys.exit instead. │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
TypeError: write() argument must be str, not dict
[ERROR]
[FAILED] Unexpected error: write() argument must be str, not dict !!!BTW, |
Member
|
I ran: and got the attached err.json. Another weird thing is that if I set {
"meta": {
"version": "0.2"
},
"validation_settings": {
"profile_identifier": "workflow-testing-ro-crate-0.1",
"enable_profile_inheritance": true,
"abort_on_first": false,
"requirement_severity": "REQUIRED",
"rocrate_validator_version": "0.6.1_bd0cc32+448-dirty"
},
"passed": false,
"issues": []
} |
…n the json output format
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR refines the JSON output generated by validating a rocrate that requires multiple profiles, not belonging to the same inheritance hierarchy.
The main changes are as follows:
profile_identifierproperty is replaced byprofile_identifiers, which will be populated with the list of validation profiles used