Author: esr
Date: Tue Apr  7 16:25:37 2009
New Revision: 34607

URL: http://svn.gna.org/viewcvs/wesnoth?rev=34607&view=rev
Log:
Feature for ShadowMaster and Espreon: "#wmllint: notecheck off"
suppresses error from traits wilth no matching notes.  "#wmllint: notecheck off"
re-enables this check.

Modified:
    trunk/data/tools/wmllint

Modified: trunk/data/tools/wmllint
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/tools/wmllint?rev=34607&r1=34606&r2=34607&view=diff
==============================================================================
--- trunk/data/tools/wmllint (original)
+++ trunk/data/tools/wmllint Tue Apr  7 16:25:37 2009
@@ -94,6 +94,10 @@
 # repair them) with "wmllint: display on", and re-enable them with
 # "wmllint: display off".  The repair attempts (only) may also be
 # suppressed with the --stringfreeze option.
+#
+# A special comment "#wmllint: notecheck off" will disable error messages on
+# traits wiuth no corresponding {SPECIAL_NOTE} explanations.  The comment
+# "#wmllint: notecheck on" will re-enable this check.
 #
 # A magic comment of the form "wmllint: general spellings word1
 # word2..."  will declare the tokens word1, word2, etc. to be
@@ -731,7 +735,13 @@
     # Note: This check is disabled on units derived via [base_unit].
     # Also, build dictionaries of unit movement types and races
     in_unit_type = None
+    notecheck = True
     for nav in WmllintIterator(lines, filename):
+        if nav.text.startswith("wmllint: notecheck off"):
+            notecheck = False
+            continue
+        elif nav.text.startswith("wmllint: notecheck on"):
+            notecheck = True
         #print "Element = %s, text = %s" % (nav.element, `nav.text`)
         if nav.element == "[unit_type]":
             unit_race = ""
@@ -762,11 +772,11 @@
                 if (notes or traits) and not has_special_notes:
                     missing_notes = ["{SPECIAL_NOTES}"] + missing_notes
                 # If the unit didn't specify hitpoints, there is some wacky
-                # stuff going on (possibly psedo-[base_unit] behavior via
+                # stuff going on (possibly psuedo-[base_unit] behavior via
                 # macro generation) so disable some of the consistency checks.
                 if not hitpoints_specified:
                     continue
-                if missing_notes:
+                if notecheck and missing_notes:
                     print '"%s", line %d: unit %s is missing notes +%s' \
                           % (filename, in_unit_type, unit_id, 
"+".join(missing_notes))
                 if missing_traits:


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to