On Mon, 30 Apr 2018, Florian Schäfer wrote:
I have a question about validator rules in JOSM, because I want to write
several new rules for the wikipedia plugin as
part of my Summer of Code.
As far as I can see the ID of each test should be unique and JOSM core uses the
IDs from 1 to 3799 (see [1]). So can I
simply choose a range of IDs at random somewhere above 3800. Or is there a
central place where all IDs that are not in
core are collected?
Much over 3800. The internal list will continue growing in steps of 100.
Something like 10000..10099
Not like PT Assistant using numbers now used by the core.
The comment on line [1] is marked with FIXME, because the current situation is
not very good. The global uniqueness of
the IDs is not guaranteed.
You misunderstand that comment. The assignment to a test is a bit broken
by concept. There are many tests now that have one ID, but actually do
many different tests (e.g. the CSS based ones). The ID based skip only
allows to skip them all or not. It should be more finegrained.
Would it make sense to no longer use integers as IDs for the TestErrors, but
instead use the
fully-qualified class name of the Test-class and an integer that only has to be
unique inside this one class?
If an integer ID is needed, the class name could be hashed (and maybe
truncated) and use the resulting bytes as ID.
No. This does not solve the problem at all, only makes it more complex.
Not the ID assignment to the test is the problem, but the subdividing of
(some) tests. Even after some years I don't really see a solution, as e.g.
strings hashes also fail in many situations. But it is probably not so
important, as most people don't even know there are ignore features for
individual tests results.
Ciao
--
http://www.dstoecker.eu/ (PGP key available)