Skip to content

Commit

Permalink
wmllint: do not warn about unknown IDs in [tunnel], except inside of …
Browse files Browse the repository at this point in the history
…[filter]
  • Loading branch information
Elvish-Hunter committed Aug 12, 2018
1 parent 6164980 commit 0bcb0e0
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion data/tools/wmllint
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 0bcb0e0

Please sign in to comment.