Elvish_Hunter
c78cc7a2b0
wmlindent: don't begin string concatenation if the line is commented out
...
Fixes a bug reported by Toranks.
2023-03-10 10:51:29 +01:00
Celtic Minstrel
473c6e468e
Fix wmlindent quote detection ( #6764 )
...
* wmlindent: Fix parsing quotes in comments
* Remove unnecessary wmlindent ignores
* Run wmlindent
2022-06-18 09:37:55 +02:00
Elvish_Hunter
c2ece934bd
wmlindent: refactored indentation level handling code
2022-04-01 22:53:44 +02:00
Alexander Lacson
518becac59
[wmltools] Fix Docstrings
...
docstrings of the keyboardinterrupt handler.
2022-02-16 12:12:37 +01:00
Alexander Lacson
24098cb54a
wmlxgettext and wmlindent change exit code
...
For keyboard interrupt change exit code from 0 to 1.
2022-02-16 12:12:37 +01:00
Elvish_Hunter
528ea56424
wmllint and wmlindent: avoid crashing on non-UTF8 files
...
Fixes #2091
2022-02-16 10:59:05 +01:00
Elvish_Hunter
b0d3097a62
Added --version flag to wmllint, wmlscope and wmlindent
...
Also made GUI.pyw report the version in the about dialog. Fixes #6346
2021-12-26 22:10:44 +01:00
max-torch
56dc9830dc
Define KeyboardInterrupt Exception Handler in wmlindent
...
Note: The signal class object was used to avoid wrapping the entire main routine in a try...except clause.
2021-11-17 23:08:37 +01:00
gfgtdf
e822e22b2f
wmlindent: don't indent #'#deprecated'
2020-10-19 23:53:52 +02:00
gfgtdf
ae9b533925
wmlindent: don't indent if #endarg is on the same line
...
this might change behaviour of the arg value
2020-10-19 23:53:52 +02:00
Elvish_Hunter
cb4c5301ad
wmlindent: fixed crash on non-existent paths
...
Fixes #3346
(cherry-picked from commit af63d17e32
)
2018-10-07 03:23:39 +00:00
Alexander van Gessel
c5b19ed66d
Make 'bailout' a valid Python3 exception
2017-10-14 23:19:51 +02:00
Charles Dang
7dcb9d09f9
wmlindent: don't inednt #arg/#endarg preprocessor tags
...
[ci ski[]
2017-09-12 21:25:22 +11:00
Bär Halberkamp
b20cb7c413
wmlindent: Indent concatenated strings
2016-09-15 18:04:37 +02:00
aquileia
809e61db88
Python scripts: Unify encoding magic comments
2016-05-03 22:12:19 +02:00
Ignacio R. Morelle
851eddfd5e
Restore executable bit on WML tools
2015-10-30 02:43:02 -03:00
Elvish_Hunter
491ba7924f
wmlindent: upgrade from optparse to argparse
2015-10-20 15:02:32 +02:00
Elvish_Hunter
526d745dfb
Converted wmlindent to Python 3
2015-09-24 11:40:13 +02:00
Elvish_Hunter
7fa2943683
All main WML tools: replaced tabs with spaces
2015-08-11 19:41:36 +02:00
Elvish_Hunter
4d675c377f
All main wml tools: used Python 3 floating point division
...
wmltools required integer division, so here the corresponding operator (//) is used
2015-08-06 23:49:40 +02:00
Elvish_Hunter
c1a783b038
all main wml tools: use filter(), map() and zip() from Python 3
...
The main difference is that these functions return generators instead of lists. This actually breaks wmlscope's collision detection, which will be fixed in my next commit.
2015-08-05 20:38:48 +02:00
Elvish_Hunter
90919e12c6
wmllint, wmlindent, wmltools: fixed dir being used as variable name
...
In Python, dir is an in-built function
2015-08-05 20:38:48 +02:00
Elvish_Hunter
501b3aa2d9
wmlindent: open files as UTF-8 and use Unicode literals
2015-08-04 10:07:57 +02:00
Elvish_Hunter
0b92bcb9bc
wmlindent: remove endlines which are automatically added by print()
2015-07-29 11:37:56 +02:00
Elvish_Hunter
c1643892e2
wmlindent: use print function with file= argument instead of sys.stderr.write
2015-07-29 11:33:58 +02:00
Elvish_Hunter
421a736c45
wmlindent: use print function instead of print statement
...
This solution has the advantage of fixing one of the most important issues when moving to Python 3.
Also, in other tools this will allow getting rid of the inconsistent usage of print>>sys.stderr/out and sys.stderr/out.write
2015-07-29 11:23:45 +02:00
Elvish_Hunter
464c3d40b3
wmlindent: use startswith()/endswith() support for tuples instead of a for cycle
2015-07-29 11:22:26 +02:00
Elvish_Hunter
07b5b4e3f3
Fixed a bug in PR #431 which broke wmlindent
2015-07-28 22:31:11 +02:00
Javier Novoa
8be183bdd9
Use with statements to open/close files on wml{indent,lint,scope}.
2015-07-27 22:15:24 -05:00
Elvish_Hunter
b6250ff165
wmlindent: check verbosity level after processing all the command line options
...
This fixes the same bug that Groggy Dice fixed in wmllint, and which caused -d -v to run wmlindent with a verbosity level of 2
2015-05-29 11:36:51 +02: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
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
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
Alexander van Gessel
7d9cae09be
Some python syntax updates for the WML tools
2013-07-26 15:38:05 +02:00
Elvish_Hunter
8200214e9b
wmllint, wmlscope and wmlindent: fixed bug caused by Windows' command prompt appending double quotes to arguments
2013-02-23 13:04:12 +00:00
Anonymissimus
f1a2eb07d1
Fix wmlindent writing CRLF end of lines on windows.
...
Its documentation says it converts to LF. Also, my wesnoth+windows
experience says it is best to use always only LF no matter what OS.
For WML at least. And I dont wanna convert back each time.
2012-01-14 17:07:58 +00:00
Thibault Févry
c408f32b5f
Strip trailing whitespaces.
...
Some other changes to make code look more pythonish. No important changes.
2011-10-22 00:17:25 +00:00
Ignacio R. Morelle
9e94b3410c
wmlindent: Update for #ifver, #ifnver
2011-03-23 03:26:58 +00:00
Ignacio R. Morelle
5341c62319
wmlindent: Update for #ifhave, #ifnhave
2011-03-23 03:20:20 +00:00
Thibault Févry
2288ef0939
Removed a lot of trailing whitespaces. Shouldn't be anymore in python scripts.
2011-03-12 02:22:21 +00:00
Alexander van Gessel
f676484395
Teach wmlindent about <<lua strings>>.
2009-07-27 01:09:42 +01:00
Eric S. Raymond
964e144790
Prevent #undef from being indented.
2009-01-05 19:01:13 +00:00
Alexander van Gessel
25c977c651
Stop wmlindent from using commented-out #enddefs.
2008-12-05 01:22:29 +01:00
Alexander van Gessel
10bc9e8733
Fix #enddef detection in wmlindent.
2008-12-03 12:24:22 +01:00
Eric S. Raymond
7df469e62e
Handle macros with an #endif not at start of line.
2008-10-28 15:05:43 +00:00
Eric S. Raymond
c927cdc6e3
Preevent wmlindent from being confused by Shadowmaster's terminal frowney.
...
(Yes, this is a real description of a real bug...)
2008-08-30 07:34:57 +00:00
Eric S. Raymond
b31c324728
Fulfil the rest of bug #12180 . Reindent appropriately.
2008-08-28 23:07:44 +00:00
Eric S. Raymond
08f09eda6f
Give wmlindent a capability to declare indenters.
...
Pre-declare {FOREACH and {NEXT.
Write declarations in the one place they're presently needed, Sceptre of Fire.
Reindent the data tree accordingly.
This partly addresses the feature request in bug #12180 .
2008-08-28 20:19:50 +00:00
Eric S. Raymond
d52a829b24
Always report changed files when reindenting.
2008-01-25 03:26:21 +00:00
Eric S. Raymond
b1b2435d40
Reindent the mainline content to uniiform whitespace.
2008-01-24 00:16:42 +00:00