build: Updating mediawiki/mediawiki-codesniffer to 33.0.0

The following sniffs are failing and were disabled:
* Generic.ControlStructures.DisallowYodaConditions.Found
* MediaWiki.Commenting.PropertyDocumentation.MissingDocumentationPrivate
* MediaWiki.Usage.ExtendClassUsage.FunctionConfigUsage
* MediaWiki.Usage.ExtendClassUsage.FunctionVarUsage

Additional changes:
* Dropped .inc files from .phpcs.xml (T200956).
* Added the `wikimedia/mediawiki` profile in .eslintrc.json (T262222).
* Added the `wikimedia/jquery` profile in .eslintrc.json (T262222).
* Removed global `$`, included in the `wikimedia/jquery` profile (T262222).
* Removed global `mw`, included via `wikimedia/mediawiki` profile (T262222).
* Dropped the emtpy global definition in .eslintrc.json.

Change-Id: I4ace90c3162ca94e401d80d9d68f278c6a2e9960
This commit is contained in:
libraryupgrader 2020-11-04 09:15:40 +00:00 committed by Umherirrender
parent 4de36d8520
commit 8f054de250
4 changed files with 15 additions and 8 deletions

View file

@ -1,11 +1,14 @@
{
"root": true,
"extends": "wikimedia",
"extends": [
"wikimedia",
"wikimedia/mediawiki",
"wikimedia/jquery"
],
"env": {
"browser": true
},
"globals": {
"mw": false,
"$": false
"rules": {
"no-jquery/no-global-selector": "warn"
}
}

View file

@ -1,12 +1,16 @@
<?xml version="1.0"?>
<ruleset>
<rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki">
<exclude name="Generic.ControlStructures.DisallowYodaConditions.Found" />
<exclude name="MediaWiki.Commenting.FunctionComment.MissingDocumentationPrivate" />
<exclude name="MediaWiki.Commenting.PropertyDocumentation.MissingDocumentationPrivate" />
<exclude name="MediaWiki.Usage.ExtendClassUsage.FunctionConfigUsage" />
<exclude name="MediaWiki.Usage.ExtendClassUsage.FunctionVarUsage" />
<exclude name="Squiz.PHP.NonExecutableCode.Unreachable" />
<exclude name="Squiz.Scope.MethodScope.Missing" />
</rule>
<file>.</file>
<arg name="extensions" value="php,inc" />
<arg name="extensions" value="php" />
<arg name="encoding" value="UTF-8" />
<exclude-pattern>vendor</exclude-pattern>
</ruleset>

View file

@ -1,6 +1,6 @@
{
"require-dev": {
"mediawiki/mediawiki-codesniffer": "31.0.0",
"mediawiki/mediawiki-codesniffer": "33.0.0",
"mediawiki/mediawiki-phan-config": "0.10.3",
"mediawiki/minus-x": "1.1.0",
"php-parallel-lint/php-console-highlighter": "0.5.0",

View file

@ -757,13 +757,13 @@ class SpecialReplaceText extends SpecialPage {
// no longer supported.
$contextBefore =
// @phan-suppress-next-line PhanUndeclaredMethod
$wgLang->truncate( $contextBefore, - $cw, '...', false );
$wgLang->truncate( $contextBefore, -$cw, '...', false );
$contextAfter =
// @phan-suppress-next-line PhanUndeclaredMethod
$wgLang->truncate( $contextAfter, $cw, '...', false );
} else {
$contextBefore =
$wgLang->truncateForDatabase( $contextBefore, - $cw, '...', false );
$wgLang->truncateForDatabase( $contextBefore, -$cw, '...', false );
$contextAfter =
$wgLang->truncateForDatabase( $contextAfter, $cw, '...', false );
}