Make wmllint id checks respect comma-separated lists of ids.

Another bug which I found due to the previous fix. I had added that
feature in the engine's SUF some time after the check in wmllint did
already no longer work.
This commit is contained in:
Anonymissimus 2012-01-20 21:37:38 +00:00
parent 6b45146d62
commit 8bdf59969f

View file

@ -1293,9 +1293,15 @@ def global_sanity_check(filename, lines):
present.append(value)
elif value in ('narrator', 'unit', 'second_unit') or (value and value[0] in ("$", "{")):
continue
elif preamble_seen and subtag_depth > 0 and not ignore_id and not in_object and not in_cfg and not in_facet and not in_sound_source and not in_remove_sound_source and not in_stage and not in_goal and not in_set_menu_item and not value in present:
print '"%s", line %d: unknown \'%s\' referred to by id' \
% (filename, i+1, value)
elif preamble_seen and subtag_depth > 0 and not ignore_id and not in_object and not in_cfg and not in_facet and not in_sound_source and not in_remove_sound_source and not in_stage and not in_goal and not in_set_menu_item:
ids = value.split(",")
for j in range(len(ids)):
# removal of leading whitespace of items in comma-separated lists
# is usually supported in the mainline wesnoth lua scripts
# not sure about trailing one
if ids[j].lstrip() not in present:
print '"%s", line %d: unknown \'%s\' referred to by id' \
% (filename, i+1, ids[j])
if markcheck and has_tr_mark and not ("wmllint: ignore" in comment or "wmllint: noconvert" in comment):
print '"%s", line %d: %s should not have a translation mark' \
% (filename, i+1, key)