Skip to content

Commit

Permalink
wmllint: Recognize [remove_time_area]
Browse files Browse the repository at this point in the history
Fixes issues with wmllint emitting spurious warnings about unit ids when
encountering time area ids in [remove_time_area].

[ci skip]
  • Loading branch information
irydacea committed Jul 25, 2020
1 parent 11d7022 commit 9fa0536
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions changelog.md
Expand Up @@ -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
Expand Down
8 changes: 7 additions & 1 deletion data/tools/wmllint
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 9fa0536

Please sign in to comment.