Skip to content

Commit

Permalink
wmllint: Ignore notes when checking for shroud and fog
Browse files Browse the repository at this point in the history
The following line was causing a wmllint error because it contains _s:

Irs, book_start Icr^Ii, Irs

"../../data/campaigns/Descent_Into_Darkness/maps/07c_A_Small_Favor3.map", line 10: warning, fog or shroud in map file
  • Loading branch information
hexagonrecursion authored and Elvish-Hunter committed Feb 2, 2021
1 parent bbf3840 commit 5735a16
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions data/tools/wmllint
Expand Up @@ -2871,10 +2871,12 @@ def translator(filename, mapxforms, textxform):
else:
fields = [x for x in line]
outmap.append(fields)
if not maskwarn and maptype == 'map' and re.search('_s|_f(?!me)', line):
print('"%s", line %d: warning, fog or shroud in map file' \
% (filename, lineno+1))
maskwarn = True
terrain_strings = (f.split()[-1] for f in fields)
if not maskwarn and maptype == 'map':
if any(re.search('_s|_f(?!me)', t) for t in terrain_strings):
print('"%s", line %d: warning, fog or shroud in map file' \
% (filename, lineno+1))
maskwarn = True
# Deduce the map type
if not map_only:
if maptype == "map":
Expand Down

0 comments on commit 5735a16

Please sign in to comment.