Commit graph

19 commits

Author SHA1 Message Date
Reedy
499dbfb4cb maintenance: Use more of namespaced Maintenance class
Change-Id: I53f2e32c73c92cc3a0deee48ebe6d13329a7a0cf
2024-10-16 01:09:19 +00:00
Dreamy Jazz
e7393b3cc7 Exclude boilerplate maintenance code from code coverage reports
Why:
* Maintenance scripts in core have bolierplate code that is
  added before and after the class to allow directly running
  the maintenance script.
* Running the maintenance script directly has been deprecated
  since 1.40, so this boilerplate code is only to support a now
  deprecated method of running maintenance scripts.
* This code cannot also be marked as covered, due to PHPUnit
  not recognising code coverage for files.
* Therefore, it is best to ignore this boilerplate code in code
  coverage reports as it cannot be marked as covered and also
  is for deprecated code.

What:
* Wrap the boilerplate code (requiring Maintenance.php and then
  later defining the maintenance script class and running if the
  maintenance script was called directly) with @codeCoverageIgnore
  comments.
* Some files use a different boilerplate code, however, these
  should also be marked as ignored for coverage for the same
  reason that coverage is not properly reported for files.

Bug: T371167
Change-Id: I32f5c6362dfb354149a48ce9c28da9a7fc494f7c
2024-08-27 13:22:29 +01:00
Derick Alangi
74033c50cd maintenance: Begin using Maintenance::getServiceContainer()
Maintenance class provides a method for getting a fresh reference
of the MW services container instance. Let's make use of these in
maintenance scripts now that we have it.

NOTE: There are still some static methods like in refreshLinks.php
that makes use of services that we can't use this method for now.

Change-Id: Idba744057577896fc97c9ecf4724db27542bf01c
2023-09-04 10:39:58 +00:00
DannyS712
6d3be0815b generatePhpCharToUpperMappings: avoid fetching service in loop
Change-Id: Ic4d3d5c9087f03cc2042e943e0359617521b2403
2022-12-21 07:35:36 +00:00
Fomafix
b28b79ddb9 Use 0 instead of "" in phpCharToUpper.json
Use 0 instead of "" to signal an unchanged character. 0 is only one
character and "" are two characters. This reduces the uncompressed size
of the JSON file by 770 byte.

Change-Id: Ibb6d2d1d9af712ad73733d3179fb82751028e054
2021-09-23 05:56:42 +00:00
Kunal Mehta
60305fd4ab maintenance: Remove executable bit from scripts without shebang
Spotted by Debian's lintian.

Change-Id: I2ffb702eb9b23a22dd83792abce2c0a5ef8eae8a
2020-07-31 18:29:19 -07:00
Ed Sanders
8b720e9bd6 eslint: Update to eslint-config-wikimedia 0.16.0
* valid-jsdoc replaced with jsdoc plugin
* New /selenium config

Change-Id: I471eebac0312cb25c539c3f6a3ecfc7cfd4ed8d6
2020-06-02 21:32:56 +01:00
Reedy
229b2c15e8 Fix a plethora of class and function call case mismatches
Bug: T231412
Change-Id: I597a25de3294a6673424f30475760280ef209a8a
2020-05-26 14:14:46 +01:00
Ed Sanders
d94f90e088 eslint: Code style fixes for upcoming config change
Change-Id: Ief44c0bb26c5a1c1773cab5dba51d5e856612bf7
2020-05-14 22:19:55 +01:00
Daimona Eaytoy
d297fe8ca2 Avoid using deprecated $wgContLang
Bug: T245940
Change-Id: I2c7fc87876a381cb1f5a8944e234876a3a72e55e
2020-02-23 13:26:40 +00:00
Ed Sanders
3c2cea4559 build: Update linters and fix errors
Change-Id: Ieb1eff174f5168bf6c9e9aaeb58ec1a1bcd33538
2019-10-23 11:22:41 +01:00
Daimona Eaytoy
9f072ed60e Fix new phan errors, part 4
Still doc-only, this ends the easy part.

Bug: T231636
Change-Id: I51f180edc57d96322b9cd46e6a32aeffcbdc3bed
2019-10-12 10:35:31 +00:00
Ed Sanders
130fe3783c eslint: Use /server rules for maintenance script
Change-Id: Ieba8c4bb2acf33e5fdd35152e193cb34fba404ac
2019-10-08 13:07:25 +01:00
Fomafix
8c30c3704f generatePhpCharToUpperMappings: Die if fopen fails
This prevents additional errors in the following code.

Change-Id: I27770e6ca09c495ec7b6cb588c251b4014697bfe
2019-09-19 09:38:23 +02:00
Timo Tijhof
decea359af mediawiki.Title: Reduce transfer size of phpCharToUpper.json
Follows-up 416895821f, which increased this payload by 1-2KB.

Bug: T233095
Change-Id: I90745fe1c1ad4389fef399a30966b123f7812506
2019-09-17 19:04:03 +00:00
Ed Sanders
ab3f30ce15 generatePhpCharToUpperMappings.php: Write output directly to json file
Change-Id: Ic19e5c9899f19d9b6ebf4a65a81100670514aa14
2019-05-02 18:33:19 -07:00
Ed Sanders
5b3106f12b Make generatePhpCharToUpperMappings.php a proper maintenance script
This allows us to use Title for converting to upper case which
will respect any compatibility fixes added later.

Bug: T219279
Change-Id: I746487df12e4628f1e37b33b7cc3cce597853596
2019-05-02 10:47:26 -07:00
Bartosz Dziewoński
67f1424f28 Change 'mediawiki.Title' to use 'packageFiles'
Seems neater.

Change-Id: Ib9a64f1b2efcc224e2d6eaf306eefa9527b6a2dd
2019-03-28 20:46:08 +01:00
Ed Sanders
799a4255a1 Title: Add scripts for generating/updating phpCharToUpper.js
Bug: T141723
Change-Id: I8355990f06b793e889d5279bada81e6ef3c242d1
2019-03-27 22:15:20 +00:00