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 8cb7139 commit 53fe325
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 @@ -6,6 +6,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 @@ -1741,6 +1741,7 @@ def global_sanity_check(filename, lines):
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 @@ -1901,6 +1902,10 @@ def global_sanity_check(filename, lines):
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 "[tunnel]" in lines[i]:
in_tunnel = True
Expand Down Expand Up @@ -2126,7 +2131,8 @@ 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_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 53fe325

Please sign in to comment.