Add a "duplicate-ids" lint category

Bug: T200517
Change-Id: Ifc3aeb167de8ef1c9a686919408d1d6fbd85c581
This commit is contained in:
Arlo Breault 2024-09-17 19:08:39 -04:00
parent e045162e23
commit 0dad8f46b0
4 changed files with 13 additions and 0 deletions

View file

@ -241,6 +241,11 @@
"enabled": true,
"priority": "none",
"no-params": true
},
"duplicate-ids": {
"dbid": 25,
"enabled": true,
"priority": "high"
}
}
},

View file

@ -11,6 +11,8 @@
"linter-category-large-tables-desc": "These pages have tables that are hard to view on mobile",
"linter-category-deletable-table-tag": "Table tag that should be deleted",
"linter-category-deletable-table-tag-desc": "These pages have table tags that should be deleted.",
"linter-category-duplicate-ids": "Duplicate Ids",
"linter-category-duplicate-ids-desc": "These pages have elements with duplicate id attributes.",
"linter-category-fostered": "Fostered content",
"linter-category-fostered-desc": "These pages have fostered content.",
"linter-category-fostered-transparent": "Fostered rendering-transparent content",
@ -78,6 +80,7 @@
"linter-pager-category-header": "Category",
"linter-pager-deletable-table-tag-details": "Table tag that should be deleted",
"linter-pager-details-header": "Additional info",
"linter-pager-duplicate-ids-details": "Duplicate ids",
"linter-pager-fostered-details": "Fostered content",
"linter-pager-fostered-transparent-details": "Fostered rendering-transparent content",
"linter-pager-html5-misnesting-details": "Misnesting (now broken)",

View file

@ -20,6 +20,8 @@
"linter-category-large-tables-desc": "Description of category\n\nSimilar messages:\n* {{msg-mw|Linter-category-bogus-image-options-desc}}\n* {{msg-mw|Linter-category-fostered-desc}}\netc.",
"linter-category-deletable-table-tag": "Name of lint error category. See [[:mw:Help:Lint errors/deletable-table-tag]]",
"linter-category-deletable-table-tag-desc": "Description of category\n\nSimilar messages:\n* {{msg-mw|Linter-category-bogus-image-options-desc}}\n* {{msg-mw|Linter-category-fostered-desc}}\netc.",
"linter-category-duplicate-ids": "Name of lint error category. See [[:mw:Help:Lint errors/duplicate-ids]]",
"linter-category-duplicate-ids-desc": "Description of category\n\nSimilar messages:\n* {{msg-mw|Linter-category-deletable-table-tag-desc}}\n* {{msg-mw|Linter-category-fostered-desc}}\netc.",
"linter-category-fostered": "Name of lint error category. See [[:mw:Help:Lint errors/fostered]]",
"linter-category-fostered-desc": "Description of category. This lint error is explained on [[mw:Special:MyLanguage/Help:Lint errors/fostered]].\n\nSimilar messages:\n* {{msg-mw|Linter-category-bogus-image-options-desc}}\n* {{msg-mw|Linter-category-deletable-table-tag-desc}}\netc.",
"linter-category-fostered-transparent": "Name of lint error category. See [[:mw:Help:Lint errors/fostered-transparent]]\n* '''“Rendering-transparent content” means: content that is invisible in output rendering.'''\n* '''“Fostered content” means: content located in a table but misplaced, i.e., not in table cells, table headings, or captions.'''",
@ -87,6 +89,7 @@
"linter-pager-category-header": "Heading of a table column showing the category of a lint error.\n{{identical|Category}}",
"linter-pager-deletable-table-tag-details": "Table column heading",
"linter-pager-details-header": "Table column heading for the linter error details",
"linter-pager-duplicate-ids-details": "Table column heading",
"linter-pager-fostered-details": "Table column heading.",
"linter-pager-fostered-transparent-details": "Table column heading.\n* '''“Rendering-transparent content” means: content that is invisible in output rendering.'''\n* '''“Fostered content” means: content located in a table but misplaced, i.e., not in table cells, table headings, or captions.'''",
"linter-pager-html5-misnesting-details": "Table column heading.",

View file

@ -249,6 +249,8 @@ class LintErrorsPager extends TablePager {
return Html::element( 'a', [
'href' => $title->getLocalUrl(),
], $title );
} elseif ( $category === 'duplicate-ids' ) {
return Html::element( 'code', [], $lintError->params['id'] );
}
return '';
case 'template':