From 7571ffb7281e5428acc8a8f876dc851161bb6dba Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Mon, 3 Nov 2008 19:47:46 +0000 Subject: [PATCH] Tighten up the implementation of spell-checking a bit, ...and fix some edge cases it catches. Also, implement a method to check ancestor scomes in WmlIterator (not yet used). --- .../units/Battle_Princess.cfg | 16 ++++++++-------- .../Heir_To_The_Throne/units/Princess.cfg | 16 ++++++++-------- .../Legend_of_Wesmere/utils/ai_controller.cfg | 2 +- .../scenarios/03_Strange_Allies.cfg | 2 +- .../units/Dwarvish_Annalist.cfg | 6 +++--- .../units/Dwarvish_Loremaster.cfg | 6 +++--- .../units/Dwarvish_Witness.cfg | 6 +++--- .../Two_Brothers/scenarios/2_The_Chase.cfg | 4 ++-- .../scenarios/08_Out_of_the_Frying_Pan.cfg | 1 + .../scenarios/scen1/map_setup.cfg | 1 - .../scenarios/scen1/survivors.cfg | 3 ++- .../units/Divine_Avatar.cfg | 2 +- .../units/Divine_Incarnation.cfg | 2 +- data/campaigns/tutorial/units/Fighteress.cfg | 8 ++++---- .../{sabre-human.png => saber-human.png} | Bin data/core/units.cfg | 6 +++--- data/core/units/dwarves/Dragonguard.cfg | 2 +- data/core/units/humans/Loyalist_Duelist.cfg | 8 ++++---- data/core/units/humans/Loyalist_Fencer.cfg | 10 +++++----- .../units/humans/Loyalist_Master_at_Arms.cfg | 12 ++++++------ data/core/units/humans/Mage_White.cfg | 2 +- data/core/units/humans/Mage_of_Light.cfg | 2 +- data/core/units/merfolk/Diviner.cfg | 2 +- data/core/units/merfolk/Priestess.cfg | 2 +- data/core/units/undead/Spirit_Spectre.cfg | 2 +- data/core/units/undead/Spirit_Wraith.cfg | 2 +- data/tools/wesnoth/wmliterator.py | 4 ++++ data/tools/wmllint | 8 +++++++- 28 files changed, 74 insertions(+), 63 deletions(-) rename data/core/images/attacks/{sabre-human.png => saber-human.png} (100%) diff --git a/data/campaigns/Heir_To_The_Throne/units/Battle_Princess.cfg b/data/campaigns/Heir_To_The_Throne/units/Battle_Princess.cfg index f2a63c67313..51bf8d0d3f0 100644 --- a/data/campaigns/Heir_To_The_Throne/units/Battle_Princess.cfg +++ b/data/campaigns/Heir_To_The_Throne/units/Battle_Princess.cfg @@ -32,9 +32,9 @@ description= _ "A noble by birth, the Princess has learnt swordplay with the greatest generals, and battle tactics with the greatest sages, making her both a great combatant and leader. Now battle-hardened and strong of will, she can now aid those around her in the art of combat."+{SPECIAL_NOTES}+{SPECIAL_NOTES_LEADERSHIP}+{SPECIAL_NOTES_SKIRMISHER} die_sound={SOUND_LIST:HUMAN_FEMALE_DIE} [attack] - name=sabre - description= _"sabre" - icon=attacks/sabre-human.png + name=saber + description= _"saber" + icon=attacks/saber-human.png type=blade range=melee damage=13 @@ -42,7 +42,7 @@ [/attack] [attack_anim] [filter_attack] - name=sabre + name=saber [/filter_attack] [frame] begin=-200 @@ -111,9 +111,9 @@ description= _ "A noble by birth, the Princess has learnt swordplay with the greatest generals, and battle tactics with the greatest sages, making her both a great combatant and leader. Now battle-hardened and strong of will, she can now aid those around her in the art of combat."{SPECIAL_NOTES}+{SPECIAL_NOTES_LEADERSHIP}+{SPECIAL_NOTES_SKIRMISHER}+{SPECIAL_NOTES_MAGICAL} die_sound={SOUND_LIST:HUMAN_FEMALE_DIE} [attack] - name=sabre - description= _"sabre" - icon=attacks/sabre-human.png + name=saber + description= _"saber" + icon=attacks/saber-human.png type=blade range=melee damage=13 @@ -146,7 +146,7 @@ [/attack_anim] [attack_anim] [filter_attack] - name=sabre + name=saber [/filter_attack] [frame] begin=-200 diff --git a/data/campaigns/Heir_To_The_Throne/units/Princess.cfg b/data/campaigns/Heir_To_The_Throne/units/Princess.cfg index f8f52d2a90b..780e1f0be0c 100644 --- a/data/campaigns/Heir_To_The_Throne/units/Princess.cfg +++ b/data/campaigns/Heir_To_The_Throne/units/Princess.cfg @@ -29,9 +29,9 @@ description= _ "A noble by birth, the Princess has learnt swordplay with the greatest generals and battle tactics with the greatest sages, making her both a great combatant and leader. The units of lower level around the Princess will fight better due to her presence. The Princess is also nimble and dextrous, having skills like that of a thief."+{SPECIAL_NOTES}+{SPECIAL_NOTES_LEADERSHIP} die_sound={SOUND_LIST:HUMAN_FEMALE_DIE} [attack] - name=sabre - description= _"sabre" - icon=attacks/sabre-human.png + name=saber + description= _"saber" + icon=attacks/saber-human.png type=blade range=melee damage=11 @@ -39,7 +39,7 @@ [/attack] [attack_anim] [filter_attack] - name=sabre + name=saber [/filter_attack] [frame] begin=-225 @@ -110,9 +110,9 @@ description= _ "A noble by birth, the Princess has learnt swordplay with the greatest generals and battle tactics with the greatest sages, making her both a great combatant and leader. The units of lower level around the Princess will fight better due to her presence. The Princess is also nimble and dextrous, having skills like that of a thief."+{SPECIAL_NOTES}+{SPECIAL_NOTES_LEADERSHIP}+{SPECIAL_NOTES_MAGICAL} die_sound={SOUND_LIST:HUMAN_FEMALE_DIE} [attack] - name=sabre - description= _"sabre" - icon=attacks/sabre-human.png + name=saber + description= _"saber" + icon=attacks/saber-human.png type=blade range=melee damage=11 @@ -145,7 +145,7 @@ [/attack_anim] [attack_anim] [filter_attack] - name=sabre + name=saber [/filter_attack] [frame] begin=-225 diff --git a/data/campaigns/Legend_of_Wesmere/utils/ai_controller.cfg b/data/campaigns/Legend_of_Wesmere/utils/ai_controller.cfg index 12bd38f549a..5af68613ccc 100644 --- a/data/campaigns/Legend_of_Wesmere/utils/ai_controller.cfg +++ b/data/campaigns/Legend_of_Wesmere/utils/ai_controller.cfg @@ -808,7 +808,7 @@ [option] id=command_quit - message= "@I don't want to be in command any more! Take care of yourselves! (Disables AI_CONTROLLER)" # wmllint: ignore + message= "@I don't want to be in command any more! Take care of yourselves! (Disables AI_CONTROLLER)" # wmllint: ignore no spellcheck [show_if] [variable] name=ai_controller.in_command diff --git a/data/campaigns/The_Hammer_of_Thursagan/scenarios/03_Strange_Allies.cfg b/data/campaigns/The_Hammer_of_Thursagan/scenarios/03_Strange_Allies.cfg index f3cd279146d..8f37e45475b 100644 --- a/data/campaigns/The_Hammer_of_Thursagan/scenarios/03_Strange_Allies.cfg +++ b/data/campaigns/The_Hammer_of_Thursagan/scenarios/03_Strange_Allies.cfg @@ -19,7 +19,7 @@ # fixed by storyline is a west-to-east road; player's troops # should start near its west end, enemy near the east. - # wmllint: local spellink Marth-Tak + # wmllint: local spelling Marth-Tak [side] type="Dwarvish Fighter" diff --git a/data/campaigns/The_Hammer_of_Thursagan/units/Dwarvish_Annalist.cfg b/data/campaigns/The_Hammer_of_Thursagan/units/Dwarvish_Annalist.cfg index 45ed32ba675..b5c7a390fb8 100644 --- a/data/campaigns/The_Hammer_of_Thursagan/units/Dwarvish_Annalist.cfg +++ b/data/campaigns/The_Hammer_of_Thursagan/units/Dwarvish_Annalist.cfg @@ -35,8 +35,8 @@ [/leading_anim] [attack] - name=chainmace - description= _"chainmace" + name=morningstar + description= _"morningstar" # wmllint: no spellcheck (until name->id) icon=attacks/mace-and-chain.png type=impact range=melee @@ -49,7 +49,7 @@ [attack_anim] [filter_attack] - name=chainmace + name=morningstar [/filter_attack] [frame] begin=-250 diff --git a/data/campaigns/The_Hammer_of_Thursagan/units/Dwarvish_Loremaster.cfg b/data/campaigns/The_Hammer_of_Thursagan/units/Dwarvish_Loremaster.cfg index c2168e441a3..89cde93966b 100644 --- a/data/campaigns/The_Hammer_of_Thursagan/units/Dwarvish_Loremaster.cfg +++ b/data/campaigns/The_Hammer_of_Thursagan/units/Dwarvish_Loremaster.cfg @@ -38,8 +38,8 @@ [/leading_anim] [attack] - name=chainmace - description= _"chainmace" + name=morningstar + description= _"morningstar" # wmllint: no spellchheck (until name->id) icon=attacks/mace-and-chain.png type=impact range=melee @@ -52,7 +52,7 @@ [attack_anim] [filter_attack] - name=chainmace + name=morningstar range=melee [/filter_attack] [frame] diff --git a/data/campaigns/The_Hammer_of_Thursagan/units/Dwarvish_Witness.cfg b/data/campaigns/The_Hammer_of_Thursagan/units/Dwarvish_Witness.cfg index cedbf2893fc..2db0084986d 100644 --- a/data/campaigns/The_Hammer_of_Thursagan/units/Dwarvish_Witness.cfg +++ b/data/campaigns/The_Hammer_of_Thursagan/units/Dwarvish_Witness.cfg @@ -40,8 +40,8 @@ [/leading_anim] [attack] - name=chainmace - description= _"chainmace" + name=morningstar + description= _"morningstar" # wmllint: no spellcheck (until name->id) icon=attacks/mace-and-chain.png type=impact range=melee @@ -54,7 +54,7 @@ [attack_anim] [filter_attack] - name=chainmace + name=morningstar [/filter_attack] [frame] begin=-250 diff --git a/data/campaigns/Two_Brothers/scenarios/2_The_Chase.cfg b/data/campaigns/Two_Brothers/scenarios/2_The_Chase.cfg index f77e301795c..72221ad303d 100644 --- a/data/campaigns/Two_Brothers/scenarios/2_The_Chase.cfg +++ b/data/campaigns/Two_Brothers/scenarios/2_The_Chase.cfg @@ -1,4 +1,4 @@ -#textdomain wesnoth-tb +0#textdomain wesnoth-tb [scenario] id=2_The_Chase name= _ "The Chase" @@ -272,7 +272,7 @@ [/message] [message] role=speaker - message= _ "It is whispered that hungry ghosts ruling this forest. and kill everyone who dares to enter." + message= _ "It is whispered that hungry ghosts rule this forest, and kill everyone who dares to enter." [/message] [message] speaker=Nil-Galion diff --git a/data/campaigns/Under_the_Burning_Suns/scenarios/08_Out_of_the_Frying_Pan.cfg b/data/campaigns/Under_the_Burning_Suns/scenarios/08_Out_of_the_Frying_Pan.cfg index e62efae21df..7e1a765aff5 100644 --- a/data/campaigns/Under_the_Burning_Suns/scenarios/08_Out_of_the_Frying_Pan.cfg +++ b/data/campaigns/Under_the_Burning_Suns/scenarios/08_Out_of_the_Frying_Pan.cfg @@ -298,6 +298,7 @@ [/ai] [/side] + # wmllint: directory spelling Tanuil [story] [part] story= _ "Chapter 8: I set out with a lightened heart and quickened step; we were going back up and I was sure that soon this underground gauntlet would be over. With the help of our new allies, I felt much more confident than I had before. Oh to feel the wind in my hair and the sun on my face. But for now we had many more miles to wend and in the monotony of the marching I let my mind wander to bigger matters." diff --git a/data/campaigns/Under_the_Burning_Suns/scenarios/scen1/map_setup.cfg b/data/campaigns/Under_the_Burning_Suns/scenarios/scen1/map_setup.cfg index c98a7eb56b6..41ecd4eb2eb 100644 --- a/data/campaigns/Under_the_Burning_Suns/scenarios/scen1/map_setup.cfg +++ b/data/campaigns/Under_the_Burning_Suns/scenarios/scen1/map_setup.cfg @@ -30,7 +30,6 @@ victory_when_enemies_defeated=no [/music] # And the story. Disclaimer, introduction to the campaign, and first scenario -# wmllint: directory spelling Tanuil [story] [part] story= _ "Note: This campaign is probably not the best one for beginners. It changes certain Wesnoth standards, such as the elves' stats and the day/night cycle. This campaign emphasizes role-playing elements and tends to have longer scenarios with changing objectives. For these reasons I strongly suggest that you occasionally save your game mid-scenario, so you won't lose all your progress if you get stuck and have to start over." diff --git a/data/campaigns/Under_the_Burning_Suns/scenarios/scen1/survivors.cfg b/data/campaigns/Under_the_Burning_Suns/scenarios/scen1/survivors.cfg index 67db857f9d1..01d0f7e1c16 100644 --- a/data/campaigns/Under_the_Burning_Suns/scenarios/scen1/survivors.cfg +++ b/data/campaigns/Under_the_Burning_Suns/scenarios/scen1/survivors.cfg @@ -12,6 +12,8 @@ # Medium: 2 giant mudcrawlers, 2 small mudcrawlers # Hard: 3 giant mudcrawlers, 1 small mudcrawler +# wmllint: local spelling Yasi Nisa + [event] name=moveto [filter] @@ -477,7 +479,6 @@ # villages. This might be not the most efficient way of doing thing when # but it saves us from some macro abuse and awkward capture checks -# wmllint: local spelling Yasi Nisa [event] name=capture [filter] diff --git a/data/campaigns/Under_the_Burning_Suns/units/Divine_Avatar.cfg b/data/campaigns/Under_the_Burning_Suns/units/Divine_Avatar.cfg index eb2f3c00bf6..64c959dedd9 100644 --- a/data/campaigns/Under_the_Burning_Suns/units/Divine_Avatar.cfg +++ b/data/campaigns/Under_the_Burning_Suns/units/Divine_Avatar.cfg @@ -29,7 +29,7 @@ [/attack] [attack] name=lightbeam - description= _"lightbeam" + description= _"lightbeam" # wmllint: no spellcheck (until nane->id) type=arcane range=ranged [specials] diff --git a/data/campaigns/Under_the_Burning_Suns/units/Divine_Incarnation.cfg b/data/campaigns/Under_the_Burning_Suns/units/Divine_Incarnation.cfg index 5e1c6d50f04..9c4c79af6e1 100644 --- a/data/campaigns/Under_the_Burning_Suns/units/Divine_Incarnation.cfg +++ b/data/campaigns/Under_the_Burning_Suns/units/Divine_Incarnation.cfg @@ -29,7 +29,7 @@ [/attack] [attack] name=lightbeam - description= _"lightbeam" + description= _"lightbeam" # wmllint: no spellcheck (until name->id) type=arcane range=ranged [specials] diff --git a/data/campaigns/tutorial/units/Fighteress.cfg b/data/campaigns/tutorial/units/Fighteress.cfg index b48ebb53181..6ecd1e8d2ef 100644 --- a/data/campaigns/tutorial/units/Fighteress.cfg +++ b/data/campaigns/tutorial/units/Fighteress.cfg @@ -17,9 +17,9 @@ description= _ "Young and brash, Fighters are skilled with swords and are vulnerable to attack from enemies. However, they have the potential to become great warriors one day." die_sound={SOUND_LIST:HUMAN_FEMALE_DIE} [attack] - name=sabre - description= _"sabre" - icon=attacks/sabre-human.png + name=saber + description= _"saber" + icon=attacks/saber-human.png type=blade range=melee damage=6 @@ -27,7 +27,7 @@ [/attack] [attack_anim] [filter_attack] - name=sabre + name=saber [/filter_attack] [frame] begin=-225 diff --git a/data/core/images/attacks/sabre-human.png b/data/core/images/attacks/saber-human.png similarity index 100% rename from data/core/images/attacks/sabre-human.png rename to data/core/images/attacks/saber-human.png diff --git a/data/core/units.cfg b/data/core/units.cfg index c5d44beb176..d90233c6ba8 100644 --- a/data/core/units.cfg +++ b/data/core/units.cfg @@ -72,16 +72,16 @@ Drakes originated from a chain of volcanic islands in the Great Ocean. A combina # wmllint: general spellings dwarf dwarves dwarvish dwarven # wmllint: general spellings Knalga Knalgan Vrug Moradin - # wmllint: general spellings muckle och busked intae - # wmllint: general spellings runesmith runesmiths + # wmllint: general spellings muckle och busked intae belike + # wmllint: general spellings runesmith runesmiths runelore # wmllint: general spellings runecraft runecrafter runecrafters # wmllint: general spellings dirtgrubber dirtgrubbers dirtgrubbing - # wmllint: general spellings runesmith runesmiths bonebag belike runelore # wmllint: general spellings nae tae yer yerselves ye'll ye're ye'd ye've # wmllint: general spellings ha' isna' havena' awa' canna' couldna' hasna' # wmllint: general spellings oursel' o' dinna' unco' wi' brawlin' inta' # wmllint: general spellings wouldna' willna' didna' dinna' # wmllint: general spellings tryin' wi'out ta'en d'ye + # wmllint: general spellings bonebag [race] id=dwarf male_name= _ "race^Dwarf" diff --git a/data/core/units/dwarves/Dragonguard.cfg b/data/core/units/dwarves/Dragonguard.cfg index a16bb727d5e..c2df98ee09b 100644 --- a/data/core/units/dwarves/Dragonguard.cfg +++ b/data/core/units/dwarves/Dragonguard.cfg @@ -32,7 +32,7 @@ [/attack] [attack] name=dragonstaff - description=_"dragonstaff" + description=_"dragonstaff" # wmllint: no spellcheck (until name->id) type=pierce range=ranged damage=40 diff --git a/data/core/units/humans/Loyalist_Duelist.cfg b/data/core/units/humans/Loyalist_Duelist.cfg index 6f6b55e6f31..1e9b9f7246d 100644 --- a/data/core/units/humans/Loyalist_Duelist.cfg +++ b/data/core/units/humans/Loyalist_Duelist.cfg @@ -68,9 +68,9 @@ Experienced fencers, who often look the part, even if not actually of noble birt [/frame] [/death] [attack] - name=sabre - description=_"sabre" - icon=attacks/sabre-human.png + name=saber + description=_"saber" + icon=attacks/saber-human.png type=blade range=melee damage=5 @@ -116,7 +116,7 @@ Experienced fencers, who often look the part, even if not actually of noble birt [/attack_anim] [attack_anim] [filter_attack] - name=sabre + name=saber [/filter_attack] [frame] begin=-250 diff --git a/data/core/units/humans/Loyalist_Fencer.cfg b/data/core/units/humans/Loyalist_Fencer.cfg index d51d6d525f7..5792b91648d 100644 --- a/data/core/units/humans/Loyalist_Fencer.cfg +++ b/data/core/units/humans/Loyalist_Fencer.cfg @@ -17,7 +17,7 @@ usage=fighter description= _ "Fencers belong to a school of thought that considers the armor most soldiers wear in combat to be their own worst enemy. While armor can only soften a blow, evading it leaves the defender completely unharmed. Being able to reliably dodge any offensive move is a luxury only afforded to the fit of body, and then only to those who endure rigorous training. -Outfitted with only a dagger and sabre, fencers are light on their feet and useful in many situations where their armor-bound peers are at a disadvantage. They take relish in dancing circles around troops like heavy infantry, mocking the weight of their full armor."+{SPECIAL_NOTES}+{SPECIAL_NOTES_SKIRMISHER} +Outfitted with only a dagger and saber, fencers are light on their feet and useful in many situations where their armor-bound peers are at a disadvantage. They take relish in dancing circles around troops like heavy infantry, mocking the weight of their full armor."+{SPECIAL_NOTES}+{SPECIAL_NOTES_SKIRMISHER} die_sound={SOUND_LIST:HUMAN_DIE} [resistance] cold=90 @@ -123,9 +123,9 @@ Outfitted with only a dagger and sabre, fencers are light on their feet and usef [/frame] [/death] [attack] - name=sabre - description=_"sabre" - icon=attacks/sabre-human.png + name=saber + description=_"saber" + icon=attacks/saber-human.png type=blade damage=4 number=4 @@ -189,7 +189,7 @@ Outfitted with only a dagger and sabre, fencers are light on their feet and usef [/idle_anim] [attack_anim] [filter_attack] - name=sabre + name=saber [/filter_attack] [frame] begin=-300 diff --git a/data/core/units/humans/Loyalist_Master_at_Arms.cfg b/data/core/units/humans/Loyalist_Master_at_Arms.cfg index 1c37e84de6e..1b5ebf83989 100644 --- a/data/core/units/humans/Loyalist_Master_at_Arms.cfg +++ b/data/core/units/humans/Loyalist_Master_at_Arms.cfg @@ -27,9 +27,9 @@ They usually have the luxury of choosing their appointments, and are free to roa {ABILITY_SKIRMISHER} [/abilities] [attack] - name=sabre - description=_"sabre" - icon=attacks/sabre-human.png + name=saber + description=_"saber" + icon=attacks/saber-human.png type=blade range=melee damage=7 @@ -103,7 +103,7 @@ They usually have the luxury of choosing their appointments, and are free to roa [/attack_anim] [attack_anim] [filter_attack] - name=sabre + name=saber [/filter_attack] [frame] begin=-200 @@ -156,7 +156,7 @@ They usually have the luxury of choosing their appointments, and are free to roa [/attack_anim] [attack_anim] [filter_attack] - name=sabre + name=saber [/filter_attack] [frame] begin=-200 @@ -209,7 +209,7 @@ They usually have the luxury of choosing their appointments, and are free to roa [/attack_anim] [attack_anim] [filter_attack] - name=sabre + name=saber [/filter_attack] [frame] begin=-200 diff --git a/data/core/units/humans/Mage_White.cfg b/data/core/units/humans/Mage_White.cfg index c57bb50a49b..54b60fac841 100644 --- a/data/core/units/humans/Mage_White.cfg +++ b/data/core/units/humans/Mage_White.cfg @@ -127,7 +127,7 @@ Though not trained for combat, they are a potent ally against magical or unnatur [/attack] [attack] name=lightbeam - description=_"lightbeam" + description=_"lightbeam" # wmllint: no spellcheck (until name->id) type=arcane range=ranged [specials] diff --git a/data/core/units/humans/Mage_of_Light.cfg b/data/core/units/humans/Mage_of_Light.cfg index c60f4534c8a..8e224153789 100644 --- a/data/core/units/humans/Mage_of_Light.cfg +++ b/data/core/units/humans/Mage_of_Light.cfg @@ -105,7 +105,7 @@ Following a strict code of piety and honor, these men and women work tirelessly [/attack] [attack] name=lightbeam - description=_"lightbeam" + description=_"lightbeam" # wmllint: no spellcheck (until name->id) type=arcane range=ranged [specials] diff --git a/data/core/units/merfolk/Diviner.cfg b/data/core/units/merfolk/Diviner.cfg index d0fbb883c66..d04c2c99848 100644 --- a/data/core/units/merfolk/Diviner.cfg +++ b/data/core/units/merfolk/Diviner.cfg @@ -71,7 +71,7 @@ [/attack] [attack] name=lightbeam - description=_"lightbeam" + description=_"lightbeam" # wmllint: no spellcheck (until name->id) type=arcane range=ranged [specials] diff --git a/data/core/units/merfolk/Priestess.cfg b/data/core/units/merfolk/Priestess.cfg index be206bcb4c5..0287b883dd8 100644 --- a/data/core/units/merfolk/Priestess.cfg +++ b/data/core/units/merfolk/Priestess.cfg @@ -68,7 +68,7 @@ [/attack] [attack] name=lightbeam - description=_"lightbeam" + description=_"lightbeam" # wmllint: no spellcheck (until name->id) type=arcane range=ranged [specials] diff --git a/data/core/units/undead/Spirit_Spectre.cfg b/data/core/units/undead/Spirit_Spectre.cfg index 1b2185e244b..75c777fac4f 100644 --- a/data/core/units/undead/Spirit_Spectre.cfg +++ b/data/core/units/undead/Spirit_Spectre.cfg @@ -43,7 +43,7 @@ The creation of these is no mean feat; the real danger in encountering one is th [/death] [attack] name=baneblade - description=_"baneblade" + description=_"baneblade" # wmllint: no spellcheck (until name->id) type=arcane range=melee damage=9 diff --git a/data/core/units/undead/Spirit_Wraith.cfg b/data/core/units/undead/Spirit_Wraith.cfg index 7c3c12203a1..57fca44ec4b 100644 --- a/data/core/units/undead/Spirit_Wraith.cfg +++ b/data/core/units/undead/Spirit_Wraith.cfg @@ -18,7 +18,7 @@ die_sound=wail-long.wav [attack] name=baneblade - description=_"baneblade" + description=_"baneblade" # wmllint: no spellcheck (until name->id) type=arcane range=melee damage=6 diff --git a/data/tools/wesnoth/wmliterator.py b/data/tools/wesnoth/wmliterator.py index 39ff62a3b9e..c6a344b072b 100644 --- a/data/tools/wesnoth/wmliterator.py +++ b/data/tools/wesnoth/wmliterator.py @@ -306,6 +306,10 @@ Important Attributes: """Emit a locator string compatible with Emacs compilation mode.""" return '"%s", line %d:' % (self.fname, self.lineno+1) + def ancestors(self): + """Return a list of tags enclosing this location.""" + return tuple(map(lambda x: x.element, self.scopes)) + def hasNext(self): """Some loops may wish to check this method instead of calling next() and handling StopIteration... note: inaccurate for ScopeIterators""" diff --git a/data/tools/wmllint b/data/tools/wmllint index ee67b2fc613..d0eaf7db4bc 100755 --- a/data/tools/wmllint +++ b/data/tools/wmllint @@ -136,6 +136,8 @@ linechanges = ( ("canyon=", "unwalkable="), # This changed after 1.5.2 ("advanceto=", "advances_to="), + # This changed after 1.5.5, to enable mechanical spellchecking + ("sabre", "saber"), ) def validate_stack(stack, filename, lineno): @@ -295,6 +297,8 @@ declared_spellings = {"GLOBAL":["I'm", "I've", "I'd", "I'll", "heh", "aide-de-camp", "teleportation", "hellspawn", "hurrah", "crafters", "bided", "overmatched", "stygian", "numbskulls", + "axe", "greatsword", "ballista", "glaive", + "morningstar", # game jargon "melee", "arcane", "day/night", "hitpoint", "hitpoints", "FFA", @@ -1152,7 +1156,9 @@ def spellcheck(fn, d): else: local_spellings += declared_spellings.get(up,[]) up = os.path.dirname(up) + local_spellings = filter(lambda w: not d.check(w), local_spellings) map(d.add_to_session, local_spellings) + # Process this individual file for nav in WmlIterator(filename=fn): #print "element=%s, text=%s" % (nav.element, `nav.text`) # Recognize local spelling exceptions @@ -1246,7 +1252,7 @@ def spellcheck(fn, d): continue print nav.whereami(), 'possible misspelling "%s"' % token # Take exceptions from name, id, and type fields - if nav.element in ("name=", "id=", "type="): + if nav.element == "id=": (key, prefix, value, comment) = parse_attribute(nav.text) value = string_strip(value) if value: