From 2d045f2a6a47c58b5bb1d77d3c836119e5978708 Mon Sep 17 00:00:00 2001 From: Elvish_Hunter Date: Sun, 12 Aug 2018 16:29:43 +0200 Subject: [PATCH] wmllint: do not warn about unknown IDs in [tunnel], except inside of [filter] --- data/tools/wmllint | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/data/tools/wmllint b/data/tools/wmllint index 6badf6ebb83a..60202ed396c3 100755 --- a/data/tools/wmllint +++ b/data/tools/wmllint @@ -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