Commit graph

28 commits

Author SHA1 Message Date
C. Scott Ananian
787a647026 Make maintenance/parse.php default to tidy output
We are deprecating the non-tidy modes of the parser.

While we're at it, remove the output wrapper by default (in
both tidy and no-tidy modes).

Bug: T198214
Change-Id: Ieb51cb0f3a8a62e272d76c368f29fb63c030c522
2018-09-25 13:31:36 -04:00
Aryeh Gregor
bca6085920 Use ParserFactory in a bunch of places
I wasn't sure how to convert the rest of the occurrences in core (there
are a significant number).

Bug: T200881
Change-Id: I114bba946cd3ea8a293121e275588c3c4d174f94
2018-08-11 00:16:17 -06:00
Kunal Mehta
e0193327bd Fix MediaWiki.Commenting.LicenseComment.InvalidLicenseTag errors
Change-Id: I936c3f5fca1a0061f215e80469f5d882cb32ee29
2018-05-23 16:23:42 -07:00
Umherirrender
ad776c7d5f Use ::class to resolve class names in maintenance scripts
This helps to find renamed or misspelled classes earlier.
Phan will check the class names

Change-Id: I1d4567f47f93eb1436cb98558388e48d35258666
2018-01-23 17:40:16 +00:00
Subramanya Sastry
ab68d05cc4 Add --tidy option to maintenance/parse.php
Change-Id: I6ec08237bd15ee2d824164a0493b7fff9ef312db
2017-03-15 09:49:02 +11:00
Reedy
1834ee3d8e Fix numerous class/function casing
Change-Id: I23982bfa0548c9ea3bdb432be7982f1563930715
2016-03-18 23:14:49 +00:00
Max Semenik
59db24e90b Use addDescription() instead of accessing mDescription directly
Change-Id: I0e2aa83024b8abf5298cfea4b21bf45722ad3103
2016-01-30 01:28:32 -08:00
Arlo Breault
72c6068300 Suppress stdin warning with --quiet
Change-Id: I789260be1c83e0f081e6b7cd84cdab291d07837e
2015-07-23 21:42:55 -07:00
Ricordisamoa
fc5fd5c37a Typo fixes and non-code tweaks
Skipped replacements:
* prefered → preferred
* prolly → probably

Skipped files:
* resources/lib/jquery.ui/jquery.ui.mouse.js
* resources/lib/jquery/jquery.form.js

Change-Id: Ib7923f362ddfca1b892bf5d601785d6b5aa5d44c
2014-12-12 18:31:15 +00:00
umherirrender
25971af694 Cleanup some docs (maintenance)
- Fixed spacing inside docs
- Makes beginning of @param/@return in capital

Change-Id: I864b8b3f1f67e34e369aba7aadaf87e7752c894d
2014-08-09 22:08:40 +02:00
Siebrand Mazeland
5a77286a1e Update formatting in maintenance/ (3/4)
Change-Id: I4390c4ea12a6a626b0e6817b6446635116ca9fe3
2014-04-23 20:09:13 +02:00
Siebrand Mazeland
cb8a938105 Pass phpcs-strict on maintenance/ (4/8)
Change-Id: Ib9ee255740681f0d32d76b75ef33b369bc87bcc1
2014-04-23 10:26:09 +02:00
umherirrender
5ca5672aac Fixed spacing
- Place commas correct
- Moved comments
- Add space after if/foreach/catch
- Reformat some conditions
- Removed trailing spaces/tabs

Change-Id: I40ccda72c418c4a33fcd675773cb08d971510cdb
2013-12-01 20:58:51 +01:00
Timo Tijhof
beb1c4a0ec phpcs: More require/include is not a function
Follows-up I1343872de7, Ia533aedf63 and I2df2f80b81.

Also updated usage in text in documentation and the
installer LocalSettingsGenerator.

Most of them were handled by this regex:
- find: (require|include|require_once|include_once)\s*\(\s*(.+?)\s*\)\s*;$
- replace: $1 $2;

Change-Id: I6b38aad9a5149c9c43ce18bd8edbab14b8ce43fa
2013-05-21 23:26:28 +02:00
Timo Tijhof
50e7985d4d phpcs: Fix WhiteSpace.LanguageConstructSpacing warnings
Squiz.WhiteSpace.LanguageConstructSpacing:
   Language constructs must be followed by a single space;
   expected "require_once expression" but found
   "require_once(expression)"

It is a keyword (e.g. like `new`, `return` and `print`). As
such the parentheses don't make sense.

Per our code conventions, we use a space after keywords like
these. We appeared to have an unwritten exception for `require`
that doesn't make sense. About 60% of require/include usage
was missing the space and/or had superfluous parentheses.

It is as silly as print("foo") or return("foo"), it works
because keywords have no significance for whitespace between
it and the expression that follows, and since experessions can
be wrapped in parentheses for clarity (e.g. when doing string
concatenation or mathematical operations) the parenthesis
before and after basiclaly just ignored.

Change-Id: I2df2f80b8123714bea7e0771bf94b51ad5bb4b87
2013-05-09 05:56:26 +02:00
umherirrender
bfb75bc8e2 Fixed spacing around parenthesis in languages/tests/maintenance
Change-Id: Idd4299d17f1fcf98ab1d635484cb4e880f35ee24
2013-04-28 15:57:34 +00:00
umherirrender
b114f5e1c1 Fixed some spacing in maintenance folder
Added spaces before if, foreach
Added some braces for one line statements

Change-Id: I9657f72996358f8c1c154cea1ea97970d973723c
2013-04-18 20:48:44 +02:00
umherirrender
15abcf71ca Added/Removed spaces around string concatenation
And added/removed spaces around some other tokens,
like +, -, *, /, <, >, =, !

Fixed windows newline style

Change-Id: I0b9c8c408f3f6bfc0d685a074d7ec468fb848fc8
2013-04-13 13:36:24 +02:00
umherirrender
926d2ee143 Remove spaces between parentheses in function calls
Change-Id: If8ec665a01b566fa5189dfcc810b2d9a17f371e1
2013-03-17 16:13:22 +01:00
Hoo man
8ffbb077b3 Use __DIR__ instead of dirname( __FILE__ )
Removed left over uses of dirname( __FILE__ ) to __DIR__, even in comments.
Running the PHP version test in maintenance/Maintenance.php earlier, so that
we no longer have to stay PHP < 5.3 compatible in there.

Change-Id: I5a00bd5c6af44b7f826c4e5576a7b3de7b5026d8
2012-08-27 23:58:28 +02:00
Alexandre Emsenhuber
e9d31f5949 Improve documentation of maintenance scripts.
Change-Id: I52ebe4d741109aef19cd8fa252243e2b6440565f
2012-08-02 21:34:23 +02:00
Antoine Musso
a9c1a81fe9 parse.php Windows uses CTRL+Z as a EOF sequence
Follow up:
1fc2bb9 - parse.php note about using ^D to end output

The previous patch assumed ^D to be the standard.

Change-Id: If573c1a03eb9679d74fcb24c1be6931eee361158
2012-07-06 20:23:24 +02:00
Antoine Musso
1fc2bb9b0e parse.php note about using ^D to end output
Change-Id: I8ddc6b565044038ba1660dcd3a5942f82420ca9a
2012-07-03 14:04:52 +02:00
Sam Reed
2c68833bfe Fix minor issue from r112988 2012-03-05 16:38:55 +00:00
Antoine Musso
092d5cadb7 make file an argument, --title is script specific
--file did not make that many sense, it is easier to just pass the filename
as an argument

Call to parent constructor was misplaced, that made the script specific
options pretends they were generic maintenance parameters.
2012-03-04 23:05:44 +00:00
Antoine Musso
46546f0519 Fix doc for maintenance/ 2012-02-08 16:55:54 +00:00
Antoine Musso
fc6bc233be Fix doxygen docs before REL1_19 branching 2012-02-01 20:53:38 +00:00
Antoine Musso
fb4aac95dd script to parse wikitext from CLI
Wikitext can be given by stdin or using a file. The wikitext will be parsed
using 'CLIParser' as a title. This can be overriden with --title option.

Example1:

$ php parse.php --title foo
''[[foo]]''^D
<p><i><strong class="selflink">foo</strong></i>
</p>

Example2:

$ echo "'''bold'''" > /tmp/foo
$ php parse.php --file /tmp/foo
<p><b>bold</b>
</p>$

Example3:
$ cat /tmp/foo | php parse.php
<p><b>bold</b>
</p>$
2011-10-26 13:39:43 +00:00