From 9fa0536eaa349eedf9f4744a7bd2791247736611 Mon Sep 17 00:00:00 2001 From: Iris Morelle Date: Sat, 25 Jul 2020 04:04:47 -0400 Subject: [PATCH] wmllint: Recognize [remove_time_area] Fixes issues with wmllint emitting spurious warnings about unit ids when encountering time area ids in [remove_time_area]. [ci skip] --- changelog.md | 2 ++ data/tools/wmllint | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 869d27857dd9..dbd55f80db6a 100644 --- a/changelog.md +++ b/changelog.md @@ -536,6 +536,8 @@ * Do not list nameless abilities in the Abilities and Ability Upgrades lists in unit descriptions in Help (issue #3060). ### Miscellaneous and bug fixes + * Made wmllint recognize [remove_time_area] in order to avoid spurious warnings about + unit ids. ## Version 1.14.13 ### Campaigns diff --git a/data/tools/wmllint b/data/tools/wmllint index 4cd3110bf677..836b6143e981 100755 --- a/data/tools/wmllint +++ b/data/tools/wmllint @@ -1859,6 +1859,7 @@ to be called on their own".format(filename, num)) in_primary_unit = False in_secondary_unit = False in_remove_event = False + in_remove_time_area = False in_tunnel = False in_filter = False in_checkbox = False @@ -2027,6 +2028,10 @@ to be called on their own".format(filename, num)) in_remove_event = True elif "[/remove_event]" in lines[i]: in_remove_event = False + elif "[remove_time_area]" in lines[i]: + in_remove_time_area = True + elif "[/remove_time_area]" in lines[i]: + in_remove_time_area = False # [tunnel] supports a [filter] sub-tag, so handle it elif has_opening_tag(lines[i], "tunnel"): in_tunnel = True @@ -2256,7 +2261,8 @@ to be called on their own".format(filename, num)) and not in_combo and not in_entry and not in_slider \ and not in_map_generator and not in_candidate_action \ and not (in_fire_event and not (in_primary_unit or in_secondary_unit)) \ - and not in_remove_event and not (in_tunnel and not in_filter): + and not in_remove_event and not in_remove_time_area \ + 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