Various tweaks for wmllint hygiene.

This commit is contained in:
Eric S. Raymond 2008-10-14 22:46:24 +00:00
parent 0d43b36615
commit aadd4578cd
6 changed files with 17 additions and 6 deletions

View file

@ -2,6 +2,7 @@
# Hand-hack strictly at your own risk
#
# trackplacer: map=data/campaigns/Descent_Into_Darkness/images/misc/descent-into-darkness.png
# wmllint: no translatables
#
#define JOURNEY_STAGE_1
{NEW_BATTLE 800 425}

View file

@ -234,7 +234,7 @@
[event]
name=start
{SET_LABEL 33 2 (_ River Telfar)}
{SET_LABEL 33 2 (_ "River Telfar")}
#Set locations known to the ai_controller
#{AI_LOCATION ID NAME RANGE X Y}

View file

@ -1,10 +1,11 @@
## ai_controller
#version 0.9
# wmllint: no translatables
#please use in a post prestart event (for example: start)
#define AI_LOCATION ID NAME RANGE X Y
#define AI_LOCATION ID NAME_STRING RADIUS X Y
[label]
text={NAME}
text={NAME_STRING}
x,y={X},{Y}
[/label]
[set_variables]
@ -13,9 +14,9 @@
[value]
x={X}
y={Y}
name={NAME}
name={NAME_STRING}
id={ID}
range={RANGE}
range={RADIUS}
[/value]
[/set_variables]
#enddef

View file

@ -3,6 +3,7 @@
# and then regenerate this instead.
#
# trackplacer: map=data/campaigns/Liberty/images/maps/wesnoth-liberty.png
# wmllint: no translatables
#define JOURNEY_STAGE_1
{NEW_BATTLE 252 252}

View file

@ -111,6 +111,7 @@ class JourneyTrack:
fp.write("# Hand-hack strictly at your own risk\n")
fp.write("#\n")
fp.write("# trackplacer: map=%s\n" % self.mapfile)
fp.write("# wmllint: no text\n")
fp.write("#\n")
index_tuples = zip(range(len(self.track)), self.track)
index_tuples = filter(lambda (i, (a, x, y)): a in segmenters,

View file

@ -80,6 +80,10 @@
# You can prevent file conversions with a comment containing
# "wmllint: noconvert" on the same line as the filename.
#
# You can suppress complaints about files without an initial textdoman line
# by embedding the magic comment "# wmllint: no translatables" in the file.
# of course, it's a good idea to be sure this assertion is actually true.
#
# You can skip checks on unbalanced WML (e.g. in a macro definition) by
# bracketing it with "wmllint: unbalanced-on" and "wmllint: unbalanced-off".
# Note that this will also disable stack-based validation on the span
@ -606,10 +610,13 @@ def sanity_check(filename, lines):
pass
# Check for textdomain strings; should be exactly one, on line 1
textdomains = []
no_text = False
for i in range(len(lines)):
if "#textdomain" in lines[i]:
textdomains.append(i+1)
if not textdomains:
elif "wmllint: no translatables":
no_text = True
if not textdomains and not no_text:
print '"%s", line 1: no textdomain string' % filename
elif textdomains[0] == 1: # Multiples are OK if first is on line 1
pass