-
Notifications
You must be signed in to change notification settings - Fork 8
feat: enhance JSON output for multi-profile validation #74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: enhance JSON output for multi-profile validation #74
Conversation
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, |
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 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_identifier
property is replaced byprofile_identifiers
, which will be populated with the list of validation profiles used