Wikipedia:Linter
This is aninformation page. It is not anencyclopedic article,nor one ofWikipedia's policies or guidelines;rather, its purpose is to explain certain aspects of Wikipedia's norms, customs, technicalities, or practices. It may reflect differing levels ofconsensusandvetting. |
The Linter extensionis aMediaWiki extensionthat aims to identify "lint": syntax errors in the code of Wikipedia pages. The lint in this case is broken and problematic markup on all wiki pages that cannot be fixed automatically by MediaWiki. The extension produces a list of these errors atSpecial:LintErrors,which editors and bots can consult to find pages that need attention. High-priority Linter issues require fi xing as they may cause pages to display in undesirable fashion.The MediaWiki wiki help pagedescribes 18 specific types of lint errors.
Background
[edit]Alinteris software that helps an author or editor of a document (such as a wiki page or a programming file) see if there may be errors in the document. The extension does this for wiki pages: it helps identify whether a page displays as the author intendedyesterdayin some cases (for example, some image options are "linted" for), and helps identify whether a page displays as the author intendedtoday,due to changes in how the MediaWiki system createsHTMLfrom wikitext. Further reasons can be found atmw:Help:Extension:Linter § Why and what to fix.
List of lint errors
[edit]High priority
[edit]- Table tag that should be deleted
- Misnested tag with different rendering in HTML5 and HTML4
- Miscellaneous issues
- Multiline table in list
- Multiple unclosed formatting tags
- Paragraph wrapping bug workaround
- Self-closed tags
- Old behaviour of link-wrapping font tags
- Whitespace parsing bug
- Unclosed quote in heading
Medium priority
[edit]Low priority
[edit]- Missing end tag
- Missing end tag in heading
- Obsolete HTML tags
- Stripped tags
- Night-mode-unaware-background-color
Tracking only
[edit]- Large tables(buggy, not an error; for tracking only; not listed on Special page)
How you can help
[edit]Editors (mostlyWikiGnomes) are going around Wikipedia working to clean uplint errors,which are sorted by severity into one of three priority levels: high, medium, and low, which relate to how badly the error affects page display, or how much the page display changed when MediaWiki parsing changed. You are welcome to join in this effort. Here are some hints:
- Each lint error page has a help link in the upper-right corner that links to a page with more information about that type of error.
- Lint error pages are sorted approximately in the order of the most recently edited being listed last. Some error pages are sorted better than others.
- Lint error pages are not necessarily complete. When a new lint error type is discovered and a page is made for it, or when the definition of a type of lint error is changed, that lint error page starts empty and is gradually filled by a process that can take several weeks or months.
- Every page'spage informationdetails how many errors of each type of lint error that page has. This section is near the end and is omitted if there are no lint errors.
- For each lint error, the count maxes out at 20 in any one page.
- It isOK to editother people'sUserand Usertalk pages,and other people's comments on talk pages; but if you do, please seeWikipedia:Talk page guidelines § Editing others' commentsfor guidance.
- Don't change the words of other editors.
- Try to preserve the appearance.
- It is OK to change the appearance in some cases if it preserves the original intent.
- It is OK to fix a missing end tag, such as a
<small>
tag improperly closed with another<small>
tag instead of</small>
,even if this changes the appearance. This is especially true if the missing end tag affects anything beyond the scope of the comment in which it appears. If a user's comment in the middle of the page causes subsequent comments or sections to be indented wrong, or be bolded or italicized or in a different font, you should insert the missing end tag, even if the page has "always" been wrong.- Fi xing such errors has become more urgent;after MediaWiki's July 2018 switch to a new linter package, many pages that used to look fine despite errors in them now show terrible appearance andaccessibilityproblems, such as fonts becoming smaller and smaller (or larger and larger) the further down the page you scroll, due to successive unclosed sizing elements.
- In a discussion about wiki or HTML markup, unclosed tags are sometimes used. For example, in a discussion about the
<div>
tag, the tag might not be surrounded by<nowiki>
markup, so the<div>
tag will be taken as markup with a missing end tag instead of simply displaying the tag. In cases like this, it is helpful to insert<nowiki>...</nowiki>
around the unescaped markup, which changes the display, shows the intent of the original comment, and fixes the missing end tag or other errors resulting from the unescaped markup.
- It is OK to fix a missing end tag, such as a
- In a discussion about errors, for example, "Why does the display get messed up when I use [some bad markup] ", it's often best to leave the bad markup in place, since otherwise the discussion won't make any sense.
- Especially on User and User talk pages, try to minimize disruption by getting your fix right on the first try. "Show preview"is your friend.
- By default, editing a base user talk page will trigger anotificationto the user, which can be annoying and should not be done in large batches. To avoid this, use a flagged bot account, and also flag the edit asminor,which will bypass the "You have new messages" notification.
- See alsoWP:HTML 5 § Obsolete elements and attributesfor a list of invalid tags and attributes, which you can detect with CSS.See below.
- Some Lint errors caused by user signatures and Template substitutions are present across a large number of pages. It is more efficient to fix such errors in a bot task rather than manual edits. You can useregex-basedinsource searchto identify patterns of errors that can be fixed by bots.
- If you find a lint error in an article, consider the possibility that the error was introduced by a recent edit that should be reverted. This is especially true forTable tag that should be deletedandFostered contentlint errors, where careless deletion of table end markup (
|}
) can cause either of these lint errors. The solution to a lint error may be to revert one or more edits. - Occasionally, large pages show up onlint error listswithout there actually being any errors on the pages themselves. If there's nothing obviously wrong with a listed page, andpage information,lintHint,andtemplate expansionshow no errors, it will often disappear from the list on its own after a while. Editors can usually expedite this bynull editingthe page in question.
Reports
[edit]- The Firefly Tools table,Outstanding linter errors on enwiki,is a chart with rows for the namespaces and columns for the type of lint error, with each cell in the chart listing the number of errors (maxed at 20 for each error type per article). This chart can help find a project of manageable size, or quickly check the number of lint errors of a certain type in a namespace, such as the Article namespace. This page is updated several times per hour.
- Wikipedia:Linter/reports/Articles by Lint Errorsis a report of articles (i.e. pages in the article namespace) that have the most lint errors.
- Wikipedia:Linter/reports/Pages by Lint Errorsis a similar report that covers pages in all namespaces. Note that the Linter error system tracks a maximum of 21 errors of any single type, so pages on this list may have more total errors than are shown in the report.
- Wikipedia:Linter/reports/Pages by Non-Font Lint Errorsis the same as the above report, but excluding pages with
<font>...</font>
tags. - Wikipedia:Linter/reports/Protected pages by Lint Errors,for protected pages by lint errors
- Recent changes of "extraneous markup" tag.
Other useful pages
[edit]Linter error count progression
[edit]Date | Outstanding linter errors | Source |
---|---|---|
28 August 2018 | 24,083,947 | [1] |
17 June 2021 | 22,450,097 | [2] |
1 March 2022 | 15,349,584 | [3] |
25 March 2022 | 13,845,831 | [4] |
1 July 2022 | 11,116,651 | [5] |
3 November 2022 | 8,890,312 | [6] |
4 February 2023 | 7,994,445 | [7] |
13 February 2023 | 6,984,595 | [8] |
23 February 2023 | 5,998,634 | [9] |
5 March 2023 | 4,999,462 | [10] |
26 March 2023 | 3,996,924 | [11] |
28 December 2023 | 3,496,968 | [12] |
Bots
[edit]Bots that are approved to run lint fi xing tasks:
Bot | Operator | Tasks | Lint fixes status (last 30 days) |
---|---|---|---|
User:Legobot | User:Legoktm | Task 41 | Active |
User:MalnadachBot | User:ಮಲ್ನಾಡಾಚ್ ಕೊಂಕ್ಣೊ | Tasks1,2,3,5,6,7,8,9,10,11,12 | Blocked as of mid-2023 |
User:Qwerfjkl (bot) | User:Qwerfjkl | Tasks27,29,31 | Active |
User:SheepLinterBot | User:Sheep8144402 | Tasks1and2 | Active |
User:WOSlinkerBot | User:WOSlinker | Tasks1,2,4,7,8,9,10,13,14,15,16,17,18,19,20,21,22 | Inactive |
User:WikiCleanerBot | User:NicoV | Tasks7,10,17,22 | Active |
Some bots use thetagfixed lint errors
which can be used to filter in the edit log or hide in your watchlist.Recent changes.
User Javascript tool: lintHint
[edit]User:PerfektesChaos/js/lintHinthas instructions for installing and using lintHint, agadgetcoded inJavaScriptthat identifies lint errors in a document in the wiki editor.
You can run lintHint repeatedly in the same edit session to see if you fixed the errors and to relocalize the error pointers. Error pointers are relative to the top of the article, so if you correct errors from the bottom up, you won't need to run lintHint again to relocalize error pointers.
The lintHint tool does not expand relative links when the page is in editing mode. For example, inPortal:Science,{{/Header}}
really means{{Portal:Science/Header}}
,but lintHint does not do this. To get lintHint to work, you can manually expand relative links. You can also useExpand templates,and enter the page name inContext title
and copy part or all of the page intoInput wikitext
.Then clickOK
and then presslintHint
.Expand templates will often help lintHint localize and identify lint errors listed on Page information but that lintHint doesn't find on its own.
After editing, pages are rechecked for lint errors, usually within seconds, but in the past sometimes delayed for hours. If lintHint says you fixed one or more lint errors, you probably did fix them, even if page information and the specific lint errors page aren't updated yet. As noted, however, lintHint can't detect errors in unexpanded relative links.
User CSS tool: lint.css
[edit]You can easily employuser CSSto detect a lot of "linty" old HTML 4 code in pages as you read, if you're aWikiGnomewho likes to do cleanup. Seemeta:User:SMcCandlish/lint.cssfor a sample CSS declaration that makes various deprecated cruft – like<tt>
,<font>
,<center>
,and<strike>
– turn pink so it sticks out like a sore thumb. You can customize as you like for your ownSpecial:MyPage/common.cssormeta:Special:MyPage/global.css,or follow the instructions at lint.css to@import
(transclude) lint.css directly into your own user CSS at this or any other WMF wiki.
This CSS only detects no-longer-valid markup; it has no means of detecting other coding errors.
Seeherefor another example.
See also
[edit]Other errors
[edit]- Wikipedia:Linter/Pages with lint errors that should not be fixed
- Wikipedia:WikiProject Check Wikipedia– project devoted to this and other types of Wikipedia code cleanup
- Category:Pages with syntax highlighting errors(830)
- Possible error: four single quote marks(some might be valid usage denoting a bold phrase inside or including single quote marks, seeMOS:SINGLE.However, even in such cases, it is useful to change
''''
to{{`}}'''
or'''{{`}}
to indicate whether the single quote is inside or outside the bold.)
Help pages
[edit]- mw:Parsing/Replacing Tidy/FAQ § What will editors need to do?– simplified instructions for fi xing pages for the modern MediaWiki parser
- Help:HTML in wikitext
- Wikipedia:HTML5– information page on technical details of updating WP code toHTML5+ CSS3, including how to replace deprecated HTML 4.01 markup; includes automated searches for obsolete markup
- Wikipedia:Manual of Style/Accessibility