Commit graph

1815 commits

Author SHA1 Message Date
jenkins-bot 1c67ed5f97 Merge "Remove static keyword from all test code" 2021-10-06 23:27:06 +00:00
jenkins-bot f16838ebc0 Merge "Remove small pieces of unused code" 2021-10-06 23:05:34 +00:00
Translation updater bot e0a89709d8 Localisation updates from https://translatewiki.net.
Change-Id: Id316bafa61489d7c66bbaf4690304cbfe7037e83
2021-10-06 09:28:57 +02:00
Ed Sanders da93a0fffa Move var declarations inline
Change-Id: I177f91e67ea2ea2ab07d64002ae80365fabdedd3
2021-10-05 17:37:33 +01:00
Translation updater bot 574217e22b Localisation updates from https://translatewiki.net.
Change-Id: Ibfe8203bd9c8e3b37f56d6386fd7983a5eac182f
2021-10-05 08:30:04 +02:00
jenkins-bot 5d3820783a Merge "Use more generic @covers tags in Serialization test" 2021-10-04 08:34:44 +00:00
Thiemo Kreuz 2a9b7be921 Remove static keyword from all test code
I'm not sure why it was done this way. It doesn't need to.

Change-Id: Ie33ead5a3b6bddc464dd47e7e3153d6b8269b4c1
2021-10-02 10:43:07 +02:00
jenkins-bot 4fe8f81dac Merge "Replace deprecated onPageContentSave hook" 2021-09-30 13:54:40 +00:00
TChin 457476611f Replace deprecated onPageContentSave hook
Bug: T291001
Change-Id: I5ac84af28a4687337bb21eafb907ac7224e67b5b
2021-09-29 13:49:10 -04:00
Translation updater bot 57724521a5 Localisation updates from https://translatewiki.net.
Change-Id: Ie4758eb5e140ddefcbbb4190ba65e8b416ce7b05
2021-09-29 09:02:14 +02:00
Translation updater bot d788bcc438 Localisation updates from https://translatewiki.net.
Change-Id: I6bcdf76c6642df5e4433634bf8c938f29076dd45
2021-09-27 08:35:40 +02:00
Alexander Vorwerk 062d099f2c Replace usage of deprecated PageProps::getInstance()
Bug: T289544
Change-Id: I1a5dc0d81063d666cbbea5be6457f97b9cf4e4fc
2021-09-26 14:12:19 +02:00
Translation updater bot cf0a9594af Localisation updates from https://translatewiki.net.
Change-Id: I9878e7667581420d7c8ca45647f940dd0469cf42
2021-09-21 08:09:28 +02:00
jenkins-bot 75ca493b68 Merge "Add test cases for (almost) all possible parsing errors" 2021-09-20 13:11:09 +00:00
Translation updater bot 6f5a5357a2 Localisation updates from https://translatewiki.net.
Change-Id: I4fd31c9b1a7f79fcc59423b2b47a9018c704f022
2021-09-17 08:45:51 +02:00
jenkins-bot a95e025212 Merge "Omit the newline from EndFormat if no parameters are present" 2021-09-15 16:43:48 +00:00
jenkins-bot 40e3dd8cb8 Merge "Update FormatString spec to match Parsoid's implementation" 2021-09-15 16:43:47 +00:00
Translation updater bot 38b6e21d68 Localisation updates from https://translatewiki.net.
Change-Id: I694ca167c21c01006eaf18a73d6f32f7120c0aab
2021-09-13 08:30:23 +02:00
libraryupgrader e5cb2df074 build: Updating composer dependencies
* mediawiki/mediawiki-phan-config: 0.10.6 → 0.11.0
* php-parallel-lint/php-parallel-lint: 1.3.0 → 1.3.1

Change-Id: I759468d63803b310d5385af517589e70db75c62c
2021-09-09 11:45:31 +00:00
Thiemo Kreuz d253fa4e28 Merge code paths in assertTemplateData() helper method
This streamlines the code of the helper method a bit, mostly by
avoiding duplication.

What actually happens is the exact same as before, with one
exception: When a test case doesn't have an expected "output",
the default (mostly empty) output does not run through the
roundtrip test. While doing this is not wrong, it doesn't tell
us anything about the specific test case.

Change-Id: I4a3d8a22c3dd6a9c5c3766195e5aef3cf37a6441
2021-09-06 08:48:01 +02:00
libraryupgrader da75004c11 build: Updating npm dependencies
* stylelint-config-wikimedia: 0.10.3 → 0.11.1
* path-parse: 1.0.6 → 1.0.7
  * https://npmjs.com/advisories/1773 (CVE-2021-23343)

Change-Id: I2e703a924c66081a653a8ddc6577d0d778439b62
2021-09-04 22:54:19 +00:00
jenkins-bot 34503ed210 Merge "Use more strict assertSame() when comparing strings" 2021-09-04 05:19:49 +00:00
Thiemo Kreuz a7e1d60c64 Revert some unnecessary en→qqx changes
This reverts parts of I6c6342c.

Change-Id: I6e0e60604e393ffde21c3528ff3a26bfc01e66a2
2021-08-31 15:26:52 +02:00
Translation updater bot cf3236da62 Localisation updates from https://translatewiki.net.
Change-Id: Idf9bb6a6c042727800a91e90507dc77e12579550
2021-08-31 08:16:10 +02:00
jenkins-bot 324502fd88 Merge "Make all tests use dummy language qqx instead of en" 2021-08-30 17:14:04 +00:00
jenkins-bot 2b1cdff0af Merge "Fix several type hints in JavaScript code" 2021-08-30 17:05:56 +00:00
Thiemo Kreuz eb12e48b14 Add test cases for (almost) all possible parsing errors
"Almost" because I found at least one that appears to be
unreachable (the very first check for null). But changing this
code is out of scope of this patch.

This also updates some of the error messages to explain the
location of the error better. It appears like the incomplete
paths are copy-paste mistakes.

I also found one duplicate test case and removed it.

Change-Id: Ic0ee9d04f5cd1060ade385ef308e70d221dd2f18
2021-08-30 15:17:21 +00:00
Thiemo Kreuz 696e3ed98f Make all tests use dummy language qqx instead of en
I find this good practice. It makes the tests more robust (e.g.
changes to a text don't make the test fail) and is potentially
faster, as no localization needs to be loaded.

Change-Id: I6c6342c80a40ab7260c35e7f1e3052aa4a9b9358
2021-08-30 17:15:41 +02:00
jenkins-bot 9afc5ef9fb Merge "Dramatically improve performance of random string generator" 2021-08-30 13:49:05 +00:00
Translation updater bot 3cfc425728 Localisation updates from https://translatewiki.net.
Change-Id: Iecd7824ac493e7978b02ed582b0028a9712f2d3e
2021-08-30 08:20:40 +02:00
Thiemo Kreuz 2232a44638 Dramatically improve performance of random string generator
This test was reported as being slow (approx. 0.1s, but still).
This new implementation is 10 times faster, while still
fulfilling the requirements. While the new algorithm is more
predictable (every chunk is guaranteed to contain every
character exactly onece), it's obviously still good enough.

Neither the exact length of the generated string nor the exact
length of the gzipped string matter. PHP's random number
generator might be different – possibly generating a string
that compresses different. Newer versions of the gzip library
possibly save an extra byte. Who knows. This test shouldn't
care, as long as the gzipped string is long enough.

Compatibility with PHP 7.1 can be dropped as it is not
supported any more since MediaWiki 1.34, as far as I can tell.

Change-Id: I8d63390c9f4baa6084f932fa34068f606696cafc
2021-08-29 14:21:52 +02:00
Thiemo Kreuz 4766216948 Remove small pieces of unused code
Mostly unused variable initializations. Note I'm inlining some
`var` keywords in this patch. This is in line with the current
style guides. See for example the discussion in I4f198e2 (search
for "hoisted" in the comments). However, I'm not changing the
entire codebase, as this is not the goal of this patch and also
just not necessary at this point.

Change-Id: Ibd80566c44584851ee2530d6b16dd28eb3db6bfe
2021-08-28 12:10:22 +02:00
Thiemo Kreuz 2cb03827cc Fix several type hints in JavaScript code
Two main mistakes:
* The {...foo} syntax is for a variable number of parameters.
  But this is not the case here.
* Optional parameters should be marked as such via [foo].

Change-Id: I0c26ea44fab6094616443ce8fae4fd47c61fd7c4
2021-08-28 12:08:28 +02:00
Thiemo Kreuz aca2722af3 Use more generic @covers tags in Serialization test
This is covering parts of the TemplateDataHooks class. This
class does have a rather simple structure:

Either hook handlers are independent from each other. We don't
need to worry about accidental coverage then and can go with a
trivial top-level @covers tag.

Or some small helper methods are called. These are parts of
what's tested and should count as covered as well, I would
argue.

Change-Id: I6f419ae80b9ad78ff86ef2922db3178b29e244a4
2021-08-28 11:12:41 +02:00
Thiemo Kreuz 930edf2419 Use more strict assertSame() when comparing strings
assertEquals() does have weird effects, like not reporting a
method that is expected to return null but returns an empty
string, and such. While it's usually not a problem, I learned
to avoid it.

Change-Id: I4f27ed5b200278021e051f1ab4d272f48e0bf344
2021-08-28 11:08:24 +02:00
Translation updater bot 8e66412aff Localisation updates from https://translatewiki.net.
Change-Id: I5e3512ae54cc20c569f94b3cb3250351972957f6
2021-08-26 08:36:59 +02:00
Translation updater bot 26cdb75a8c Localisation updates from https://translatewiki.net.
Change-Id: Ifd709246d13167a00ff38e2938fdd9d22783b19f
2021-08-23 09:04:25 +02:00
Translation updater bot ea1375237f Localisation updates from https://translatewiki.net.
Change-Id: I6975c696dc846450ec1646572e957967496b0743
2021-08-19 08:13:55 +02:00
Translation updater bot fbf070a68a Localisation updates from https://translatewiki.net.
Change-Id: Iec0cbf6a7e395740fd7a1709b897900332c6fa28
2021-08-16 08:16:55 +02:00
Translation updater bot e56d2000d1 Localisation updates from https://translatewiki.net.
Change-Id: I4afe049f142073074905558a3f472955283212a7
2021-08-13 08:19:14 +02:00
Translation updater bot c210d3da3d Localisation updates from https://translatewiki.net.
Change-Id: I77c14b4e625474dba7e457172ad4c5a150de6d2e
2021-08-12 08:09:52 +02:00
Translation updater bot 5610bb38bd Localisation updates from https://translatewiki.net.
Change-Id: Ibe441fbfca6a7fad25e7aa82581f847baaaf1e96
2021-08-11 08:19:37 +02:00
Translation updater bot db2ac0172d Localisation updates from https://translatewiki.net.
Change-Id: I9f188b4ef03ad32b38428a094e24114ff7797370
2021-08-09 08:25:17 +02:00
Translation updater bot b0cd82c211 Localisation updates from https://translatewiki.net.
Change-Id: Icab9d488756704478a3fb31e7645fe987a35d8e5
2021-08-06 08:14:00 +02:00
Translation updater bot d51d63ab9c Localisation updates from https://translatewiki.net.
Change-Id: Ibb6b3ebe3cae128603f823b944c94f9c0d25d384
2021-08-04 08:15:23 +02:00
jenkins-bot b745f0961a Merge "Make parameter order when sorting by status independent of language" 2021-08-02 12:51:37 +00:00
jenkins-bot 73d5a6504d Merge "Change param duplicate numbering to start with 2" 2021-07-30 14:17:47 +00:00
jenkins-bot ffeaea6921 Merge "Fix handling of duplicate parameter names" 2021-07-30 14:11:09 +00:00
jenkins-bot 6871af2766 Merge "Remove unused pieces of code from API module" 2021-07-30 13:45:49 +00:00
Thiemo Kreuz c2508a78ad Make parameter order when sorting by status independent of language
At the moment, when the user clicks the "Status" column to
sort by status, the statuses are ordered alphabetically,
which gives widely varying results depending on the language.
But there is an inherent order for these, even hard-coded in
the code: When a parameter is deprecated, nothing else matters.
Otherwise it's required → suggested → optional. Doesn't it
make much more sense to order the column this way? Especially
because there are never more than these 4 hard-coded values.

This is one of the (few remaining) issues mentioned on
https://de.wikipedia.org/wiki/Vorlage:TemplateData#Vorlagendokumentationsseite_verbessern_%E2%80%93_MediaWiki_ungen%C3%BCgend

This patch also makes it so that a CSS class name is always
added to all status fields, not only to the required ones.
This allows for per-wiki or per-user styling.

Change-Id: Id3f1ffafe09a3817972a4ee4bd4a3ded7be6f039
2021-07-30 13:42:00 +00:00