Commit graph

1944 commits

Author SHA1 Message Date
Ignacio R. Morelle
b0373525b3 wmllint: Recognize help_topic_text as a translatable attribute
The attribute is used in [terrain_type] and it was first implemented in
a28cfc3fd9.
2013-12-04 17:01:56 -03:00
Bär Halberkamp
ffe06509c9 Fixed wmllint with my latest commits 2013-12-04 20:29:28 +01:00
Ignacio R. Morelle
2990819325 units.w.o: Upload to baldras.w.o instead of asheviere.w.o 2013-10-07 02:32:14 -03:00
Alexander van Gessel
a922551302 Don't compare a boolean to None 2013-10-06 02:26:18 +02:00
Elvish_Hunter
257c8aec88 wmllint: implemented new sanity check for leader and nozoc ellipses 2013-09-26 21:07:08 +02:00
Elvish_Hunter
94c33bf9af wmllint: stop complaining about unknown IDs inside [clear_menu_item] 2013-09-21 10:10:50 +02:00
Andrius Silinskas
8fa57b4150 Mark "new_game_title" as translatable in wmllint.
Relevant strings were adjusted in LoW.
2013-09-20 19:14:33 +01:00
Alexander van Gessel
d8982af444 Fix a typo fix 2013-08-24 21:13:24 +02:00
Thibault Févry
a89f78f469 Fix more typos. 2013-08-24 19:28:19 +02:00
Thibault Févry
df427826fa Fix typos in terrain2wiki.py 2013-08-24 19:16:14 +02:00
Thibault Févry
98b8822ccf Fix typos in data/tools/wesnoth files. 2013-08-24 19:13:24 +02:00
Thibault Févry
8ed68f5c55 Ran reindent so we don't use tabs. 2013-08-24 18:53:46 +02:00
Thibault Févry
dee75eeef0 Fix indent. 2013-08-24 18:47:00 +02:00
Groggy Dice
d3bb951548 check for textdomain paths without '/translations', and binary paths referring to 'external' data
The convention that [textdomain] uses "/translations" is strongly established, and I can't think of a legitimate reason for an add-on not to be following it.

The binary path check is a crude test. The names that took hold for menu image directories are "/public" and variations of "/external*", so we look for those strings. It does not catch the worst case of all - when all binaries are outside the campaign define, not just a set-aside directory.

I first thought of these checks while brainstorming ways to use the in_textdomain and in_binary_path code in hack_syntax(). However, realizing that these checks did not really hack any syntax, I wanted to find someplace in the sanity checks where the code would fit. I finally found it.
2013-08-21 04:39:44 -04:00
Groggy Dice
6cf03fe827 fix wmltools' parse_attribute to not consider pango color hashes as a comment
While there are many places that wmllint assumes that "#" begins a comment, from Vultraz's description it sounded like parse_attribute was being used to find the attribute's value, and then a string_strip was done on the value. So I looked for the direct cause in wmltools.

Again, the solution is to look for whitespace to precede the hashsign.

Incidentally, I don't know why the original code had the first "where -= 1", then had value and comment go from [:where+1] and [where+1:].
2013-08-19 22:06:16 -04:00
Groggy Dice
d90f082312 wmlindent: fix pango indentation-stopping bug (pointed out by vultraz)
I had a hunch that the hash would be the problem, because I realized that wmllint usually just looked for '#' to figure out if a line contained a comment, and that this also matched pango color coding. My wmllint backslash/userdata commits used this same re.split match to prevent this false positive.

(It won't prevent all unintended matches, e.g. "Guard #4", but I don't think that can be helped.)

The problem came, I believe, when the old line interacted with the block ten lines down:

        elif eligible.count('"') % 2:
            dostrip = not dostrip

The value's closing quote was on the other side of the split.
2013-08-18 23:08:19 -04:00
Groggy Dice
8b3aba7ccb wmllint: extend scenario check to include first scenario
Some newbie authors run into trouble at this point!
2013-08-17 19:27:00 -04:00
Groggy Dice
93af90d2db additions to wmllint help
Here's the rationale for these additions:

* There is so much focus on wmllint's role in conversion, that many people may not think of it as a validator also (I didn't). So often, stumped authors ask in the forums about problems that would have been fixed or pointed out if they'd run wmllint. I want to encourage awareness of wmllint as a validator.

* Folded a line to fit normal 80-width CLI.

* Help contained no mention of this rather redundant option.

* How many people don't realize that ESR's long introduction is there?

* Some users may not understand why they're being dumped back to wmllint's help.
2013-08-17 19:26:52 -04:00
Groggy Dice
db560619e8 wmllint: add switch -K --known for suppresing consistency_check()
I used "inconsistency" for the actual variable name, because "known" seems more likely to be accidentally reused.

I pondered whether to allow the scenario check to go forward, but decided to just make a clean break.

Note that this does not prevent any of the information-gathering for the consistency check, just the check itself.

Why would you want to use this option? Of course, you should run the consistency check at some point. But if you simply want to recheck if you've fixed all the bugs in your campaign, you might not want to have wmllint slog through data/core again.
2013-08-17 19:26:44 -04:00
Groggy Dice
46e9d8dc1d wmllint: bugfix missing "stringfreeze" long argument in getopt, and correct help description
According to the introduction, stringfreeze does *not* suppress the warning, and the code bears this out.

I wonder how often this option is actually used.
2013-08-17 19:26:36 -04:00
Groggy Dice
45fa75c082 change introduction's reference to checking out wmllint from 1.4 branch, to wmllint-1.4 2013-08-17 19:26:29 -04:00
Groggy Dice
8335d131bd wmllint-1.4: revise help to reflect its current status as an adjunct to current wmllint 2013-08-15 20:43:57 -04:00
Groggy Dice
a315603d2c wmllint: bugfix "unresolved scenario" check 2013-08-15 19:20:50 -04:00
Groggy Dice
c3863ac222 implement keyword 'unwho ALL' for clearing all "wmllint: who" entries at end of campaign
I realized that as it stood, my dictionary would linger, bad if wmllint were being run on multiple campaigns. A special unwho keyword, 'all', clears the dictionary.
2013-08-15 19:13:22 -04:00
Groggy Dice
a8a65c25b2 add explanation about how to use "wmllint: who" magic comments to introduction 2013-08-15 01:22:05 -04:00
Groggy Dice
ab18d94117 magic comment to remove items from whopairs dictionary
If no more scenarios will be using a macro, you can remove it from the dictionary with "unwho".
2013-08-15 01:21:46 -04:00
Groggy Dice
56be5f2f6b recognize characters from "wmllint: who" macros and append to present
Now that we see how the whopairs are recognized, we can see that the magic comment accepts a comma-separated list, for macros that deal with more than one character.

We also see that if it is necessary to remove a character who leaves the party, this can be done with another entry prefixed by double minuses.
2013-08-15 01:21:28 -04:00
Groggy Dice
21c50ccb2e create magic comment for persistent macro character recognition, "wmllint: who"
The "recognize" magic comment only covers one scenario; but what about macros that are used in many scenarios?

This new magic comment creates dictionary pairs of macros with the characters they are associated with. If this is not yet clear, hopefully the following commits will show the full picture.
2013-08-15 01:21:14 -04:00
Alexander van Gessel
abe67d8136 Merge branch 'master' of github.com:wesnoth/wesnoth-old 2013-08-09 00:20:02 +02:00
Alexander van Gessel
38b224c1ff Revert "Revert "Merge branch 'master' of github.com:wesnoth/wesnoth-old""
This reverts commit 23b72d6956.
2013-08-09 00:13:46 +02:00
Thibault Févry
e825989bbe More range() genocide. 2013-08-09 00:13:03 +02:00
Thibault Févry
1dc00f0d93 More range() destruction. 2013-08-08 23:53:34 +02:00
Thibault Févry
e4a1dcdb88 More range to xrange conversion. 2013-08-08 23:46:36 +02:00
Thibault Févry
961dcb8c25 Remove useless ';' 2013-08-08 23:45:52 +02:00
Thibault Févry
b5319fa235 Use xrange instead of range. 2013-08-08 23:41:50 +02:00
Thibault Févry
e3fbfe5225 Use for i in iterable instead of for i in range(len(iterable)). Have a hard time testing it well, but it seems to not break anything. 2013-08-08 23:35:11 +02:00
Thibault Févry
5a5287b1f7 Use string formatting when possible. Can't use str.format() (although it would be easier to read since it was only added in 2.6 2013-08-08 19:21:39 +02:00
Thibault Févry
f4fc1c5912 Make pep8 happier. 2013-08-08 19:07:47 +02:00
Thibault Févry
65a14eff16 Fix indenting (again) 2013-08-08 18:56:11 +02:00
Thibault Févry
23b72d6956 Revert "Merge branch 'master' of github.com:wesnoth/wesnoth-old"
This reverts commit 5fa5c03411, reversing
changes made to 06374c64ba.
2013-08-08 18:50:46 +02:00
Thibault Févry
ddfc7d3282 Revert "Fix indenting."
This reverts commit ab58cc959c.
2013-08-08 18:48:45 +02:00
Thibault Févry
ab58cc959c Fix indenting. 2013-08-08 18:31:47 +02:00
Thibault Févry
5fa5c03411 Merge branch 'master' of github.com:wesnoth/wesnoth-old 2013-08-08 13:18:10 +02:00
Alexander van Gessel
a678898f4c Move from optparse to argparse 2013-08-04 22:58:19 +02:00
Alexander van Gessel
2a13cfd439 Move from optparse to argparse 2013-08-04 22:54:59 +02:00
Alexander van Gessel
a89e9c4329 Move from optparse to argparse 2013-08-04 22:53:16 +02:00
Alexander van Gessel
c50aaf8025 Move from optparse to argparse 2013-08-04 22:51:18 +02:00
Alexander van Gessel
83f234f4be Move from optparse to argparse 2013-08-04 22:48:01 +02:00
Alexander van Gessel
2148f769f4 Move from optparse to argparse 2013-08-04 22:45:21 +02:00
Alexander van Gessel
b6f3f8fe35 Move from optparse to argparse 2013-08-04 22:44:15 +02:00