wmllint: do not warn about unknown IDs in [tunnel], except inside of [filter]

(cherry-picked from commit 2d045f2a6a)
This commit is contained in:
Elvish_Hunter 2018-08-12 16:29:43 +02:00
parent 2b0bbd8280
commit 46f9d93c4c

View file

@ -1691,6 +1691,8 @@ def global_sanity_check(filename, lines):
in_primary_unit = False
in_secondary_unit = False
in_remove_event = False
in_tunnel = False
in_filter = False
in_checkbox = False
in_combo = False
in_entry = False
@ -1845,6 +1847,15 @@ def global_sanity_check(filename, lines):
in_remove_event = True
elif "[/remove_event]" in lines[i]:
in_remove_event = False
# [tunnel] supports a [filter] sub-tag, so handle it
elif "[tunnel]" in lines[i]:
in_tunnel = True
elif "[/tunnel]" in lines[i]:
in_tunnel = False
elif "[filter]" in lines[i]:
in_filter = True
elif "[/filter]" in lines[i]:
in_filter = False
# sub-tags of [options] tag
elif "[checkbox]" in lines[i]:
in_checkbox = True
@ -2060,7 +2071,7 @@ def global_sanity_check(filename, lines):
and not in_combo and not in_entry and not in_slider \
and not in_map_generator \
and not (in_fire_event and not (in_primary_unit or in_secondary_unit)) \
and not in_remove_event:
and not in_remove_event and not (in_tunnel and not in_filter):
ids = value.split(",")
for id_ in ids:
# removal of leading whitespace of items in comma-separated lists