Detect and warn of a missing ID field in a [race] tag.

Addresses bug #16101: WMLint should handle missing id key in [race].
This commit is contained in:
Eric S. Raymond 2010-07-12 15:39:03 +00:00
parent 1a5cc1437e
commit d9b3abc945

View file

@ -531,9 +531,9 @@ def validate_on_pop(tagstack, closer, filename, lineno):
if "units" not in filename and closer == "unit" and "race" in attributes:
print '"%s", line %d: [unit] needs hand fixup to [unit_type]' % \
(filename, lineno)
if closer == "campaign" and "id" not in attributes:
print '"%s", line %d: campaign has no ID' % \
(filename, lineno)
if closer in ["campaign" or "race"] and "id" not in attributes:
print '"%s", line %d: %s requires an ID field but has none' % \
(filename, lineno, closer)
if closer == "terrain" and attributes.get("heals") in ("true", "false"):
print '"%s", line %d: heals attribute no longer takes a boolean' % \
(filename, lineno)