Make function swh.model.identifiers.parse_swhid more strict
Making it strict by respecting the documented grammar [1]
Currently, it misses some checks on:
- !255 (closed): the context qualifier (origin, visit, ...) so anybody can provide noisy swhid and be fine with it
- !256 (closed): whitespaces that should be refused anywhere in the string and it's not
It should also raise when those invalid SWHIDs are provided [2]
The end goal being to avoid another parsing layer in other swh users of that function.
Migrated from T2769 (view on Phabricator)
Edited by Phabricator Migration user