zimeon / ocfl-py

OCFL tools in Python
MIT License
20 stars 7 forks source link

Fix spec links in error reporting to use the appropriate spec version #125

Closed zimeon closed 1 month ago

zimeon commented 1 month ago

Currently links are to v1.0 regardless of the object or storage root version, e.g.

ocfl-py> ./ocfl-validate.py fixtures/1.0/bad-objects/E025_wrong_digest_algorithm
[E001a] OCFL Object root contains unexpected file: inventory.json.md5 (see https://ocfl.io/1.0/spec/#E001)
...
OCFL v1.0 Object at fixtures/1.0/bad-objects/E025_wrong_digest_algorithm is INVALID

ocfl-py> ./ocfl-validate.py fixtures/1.1/bad-objects/E025_wrong_digest_algorithm
[E001a] OCFL Object root contains unexpected file: inventory.json.md5 (see https://ocfl.io/1.0/spec/#E001)
....
OCFL v1.1 Object at fixtures/1.1/bad-objects/E025_wrong_digest_algorithm is INVALID
zimeon commented 1 month ago

Now:

> ./ocfl-validate.py fixtures/1.0/warn-objects/W004_uses_sha256
[W004] OCFL Object root inventory SHOULD use sha512 but uses sha256 as the DigestAlgorithm (see https://ocfl.io/1.0/spec/#W004)
OCFL v1.0 Object at fixtures/1.0/warn-objects/W004_uses_sha256 is VALID
> 
> ./ocfl-validate.py fixtures/1.1/warn-objects/W004_uses_sha256
[W004] OCFL Object root inventory SHOULD use sha512 but uses sha256 as the DigestAlgorithm (see https://ocfl.io/1.1/spec/#W004)
OCFL v1.1 Object at fixtures/1.1/warn-objects/W004_uses_sha256 is VALID