mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Linter
synced 2024-11-27 17:20:12 +00:00
Remove ParserMigration association
Bug: T333179 Change-Id: Ifc6676c3f873aeb1655f3cb1b549a5dd55bc4d85
This commit is contained in:
parent
58c71a0136
commit
e978607d56
|
@ -104,15 +104,13 @@
|
||||||
"dbid": 6,
|
"dbid": 6,
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"priority": "high",
|
"priority": "high",
|
||||||
"has-name": true,
|
"has-name": true
|
||||||
"parser-migration": true
|
|
||||||
},
|
},
|
||||||
"deletable-table-tag": {
|
"deletable-table-tag": {
|
||||||
"dbid": 7,
|
"dbid": 7,
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"priority": "high",
|
"priority": "high",
|
||||||
"has-name": true,
|
"has-name": true
|
||||||
"parser-migration": true
|
|
||||||
},
|
},
|
||||||
"misnested-tag": {
|
"misnested-tag": {
|
||||||
"dbid": 8,
|
"dbid": 8,
|
||||||
|
@ -123,14 +121,12 @@
|
||||||
"pwrap-bug-workaround": {
|
"pwrap-bug-workaround": {
|
||||||
"dbid": 9,
|
"dbid": 9,
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"priority": "high",
|
"priority": "high"
|
||||||
"parser-migration": true
|
|
||||||
},
|
},
|
||||||
"tidy-whitespace-bug": {
|
"tidy-whitespace-bug": {
|
||||||
"dbid": 10,
|
"dbid": 10,
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"priority": "high",
|
"priority": "high"
|
||||||
"parser-migration": true
|
|
||||||
},
|
},
|
||||||
"multi-colon-escape": {
|
"multi-colon-escape": {
|
||||||
"dbid": 11,
|
"dbid": 11,
|
||||||
|
@ -141,41 +137,35 @@
|
||||||
"dbid": 12,
|
"dbid": 12,
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"priority": "high",
|
"priority": "high",
|
||||||
"has-name": true,
|
"has-name": true
|
||||||
"parser-migration": true
|
|
||||||
},
|
},
|
||||||
"tidy-font-bug": {
|
"tidy-font-bug": {
|
||||||
"dbid": 13,
|
"dbid": 13,
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"priority": "high",
|
"priority": "high",
|
||||||
"has-name": true,
|
"has-name": true
|
||||||
"parser-migration": true
|
|
||||||
},
|
},
|
||||||
"multiple-unclosed-formatting-tags": {
|
"multiple-unclosed-formatting-tags": {
|
||||||
"dbid": 14,
|
"dbid": 14,
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"priority": "high",
|
"priority": "high",
|
||||||
"has-name": true,
|
"has-name": true
|
||||||
"parser-migration": true
|
|
||||||
},
|
},
|
||||||
"unclosed-quotes-in-heading": {
|
"unclosed-quotes-in-heading": {
|
||||||
"dbid": 15,
|
"dbid": 15,
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"priority": "high",
|
"priority": "high",
|
||||||
"has-name": true,
|
"has-name": true
|
||||||
"parser-migration": true
|
|
||||||
},
|
},
|
||||||
"multiline-html-table-in-list": {
|
"multiline-html-table-in-list": {
|
||||||
"dbid": 16,
|
"dbid": 16,
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"priority": "high",
|
"priority": "high"
|
||||||
"parser-migration": true
|
|
||||||
},
|
},
|
||||||
"misc-tidy-replacement-issues": {
|
"misc-tidy-replacement-issues": {
|
||||||
"dbid": 17,
|
"dbid": 17,
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"priority": "high",
|
"priority": "high"
|
||||||
"parser-migration": true
|
|
||||||
},
|
},
|
||||||
"wikilink-in-extlink": {
|
"wikilink-in-extlink": {
|
||||||
"dbid": 18,
|
"dbid": 18,
|
||||||
|
|
|
@ -51,12 +51,6 @@ class CategoryManager {
|
||||||
self::NONE => [],
|
self::NONE => [],
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
|
||||||
* @var bool[]
|
|
||||||
* @phan-var array<string,bool>
|
|
||||||
*/
|
|
||||||
private $parserMigrationCategories = [];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var bool[]
|
* @var bool[]
|
||||||
* @phan-var array<string,bool>
|
* @phan-var array<string,bool>
|
||||||
|
@ -77,9 +71,6 @@ class CategoryManager {
|
||||||
if ( $info['enabled'] ) {
|
if ( $info['enabled'] ) {
|
||||||
$this->categories[$info['priority']][] = $name;
|
$this->categories[$info['priority']][] = $name;
|
||||||
}
|
}
|
||||||
if ( $info['parser-migration'] ?? false ) {
|
|
||||||
$this->parserMigrationCategories[$name] = true;
|
|
||||||
}
|
|
||||||
if ( $info['has-name'] ?? false ) {
|
if ( $info['has-name'] ?? false ) {
|
||||||
$this->hasNameParam[$name] = true;
|
$this->hasNameParam[$name] = true;
|
||||||
}
|
}
|
||||||
|
@ -100,14 +91,6 @@ class CategoryManager {
|
||||||
sort( $this->categories[self::NONE] );
|
sort( $this->categories[self::NONE] );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param string $name
|
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
public function needsParserMigrationEdit( $name ) {
|
|
||||||
return isset( $this->parserMigrationCategories[$name] );
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $name
|
* @param string $name
|
||||||
* @return bool
|
* @return bool
|
||||||
|
|
|
@ -20,7 +20,6 @@
|
||||||
|
|
||||||
namespace MediaWiki\Linter;
|
namespace MediaWiki\Linter;
|
||||||
|
|
||||||
use ExtensionRegistry;
|
|
||||||
use Html;
|
use Html;
|
||||||
use IContextSource;
|
use IContextSource;
|
||||||
use InvalidArgumentException;
|
use InvalidArgumentException;
|
||||||
|
@ -53,11 +52,6 @@ class LintErrorsPager extends TablePager {
|
||||||
*/
|
*/
|
||||||
private $linkRenderer;
|
private $linkRenderer;
|
||||||
|
|
||||||
/**
|
|
||||||
* @var bool
|
|
||||||
*/
|
|
||||||
private $haveParserMigrationExt;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var int|null
|
* @var int|null
|
||||||
*/
|
*/
|
||||||
|
@ -118,7 +112,6 @@ class LintErrorsPager extends TablePager {
|
||||||
$this->title = $title;
|
$this->title = $title;
|
||||||
$this->throughTemplate = $throughTemplate;
|
$this->throughTemplate = $throughTemplate;
|
||||||
$this->tag = $tag;
|
$this->tag = $tag;
|
||||||
$this->haveParserMigrationExt = ExtensionRegistry::getInstance()->isLoaded( 'ParserMigration' );
|
|
||||||
parent::__construct( $context );
|
parent::__construct( $context );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -226,13 +219,6 @@ class LintErrorsPager extends TablePager {
|
||||||
if ( !$lintError ) {
|
if ( !$lintError ) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
if ( $this->haveParserMigrationExt &&
|
|
||||||
$this->categoryManager->needsParserMigrationEdit( $category )
|
|
||||||
) {
|
|
||||||
$editAction = 'parsermigration-edit';
|
|
||||||
} else {
|
|
||||||
$editAction = 'edit';
|
|
||||||
}
|
|
||||||
|
|
||||||
switch ( $name ) {
|
switch ( $name ) {
|
||||||
case 'title':
|
case 'title':
|
||||||
|
@ -245,7 +231,7 @@ class LintErrorsPager extends TablePager {
|
||||||
$title,
|
$title,
|
||||||
$this->msg( $editMsgKey )->text(),
|
$this->msg( $editMsgKey )->text(),
|
||||||
[],
|
[],
|
||||||
[ 'action' => $editAction, 'lintid' => $lintError->lintId, ]
|
[ 'action' => 'edit', 'lintid' => $lintError->lintId, ]
|
||||||
);
|
);
|
||||||
|
|
||||||
$historyLink = $this->linkRenderer->makeLink(
|
$historyLink = $this->linkRenderer->makeLink(
|
||||||
|
|
Loading…
Reference in a new issue