Extension:Linter
| Linter Release status: stable |
|
|---|---|
| Implementation | Special page |
| Description | Expose and track lint errors |
| Author(s) | Kunal Mehta (Legoktmtalk) |
| Database changes | Yes |
| Tables | linter |
| License | GNU General Public License 2.0 or later |
| Download | README |
| Translate the Linter extension if it is available at translatewiki.net | |
| Check usage and version matrix. | |
| Issues | Open tasks · Report a bug |
The Linter extension tracks lint errors from an external service. Currently the main use case is to track the errors identified by Parsoid and expose them to editors. Help for users wanting to fix errors is available at Help:Extension:Linter.
Installation[edit]
- Download and place the file(s) in a directory called
Linterin yourextensions/folder.
- Add the following code at the bottom of your LocalSettings.php:
wfLoadExtension( 'Linter' );
- Run the update script which will automatically create the necessary database tables that this extension needs.
Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.
To users running MediaWiki 1.24 or earlier:
The instructions above describe the new way of installing this extension using wfLoadExtension() If you need to install this extension on these earlier versions (MediaWiki 1.24 and earlier), instead of wfLoadExtension( 'Linter' );, you need to use:
require_once "$IP/extensions/Linter/Linter.php";
Configuration parameters[edit]
In your Parsoid config.yaml, set:
linting: true
linter:
sendAPI: true
API[edit]
list=linterrors (lnt)
- This module requires read rights.
- Source: Linter
- License: GPL-2.0-or-later
Get a list of lint errors
- lntcategories
Categories of lint errors
- Values (separate with | or alternative): deletable-table-tag, html5-misnesting, misc-tidy-replacement-issues, multiline-html-table-in-list, multiple-unclosed-formatting-tags, pwrap-bug-workaround, self-closed-tag, tidy-font-bug, tidy-whitespace-bug, unclosed-quotes-in-heading, bogus-image-options, fostered, misnested-tag, multi-colon-escape, missing-end-tag, obsolete-tag, stripped-tag
- Default: deletable-table-tag|html5-misnesting|misc-tidy-replacement-issues|multiline-html-table-in-list|multiple-unclosed-formatting-tags|pwrap-bug-workaround|self-closed-tag|tidy-font-bug|tidy-whitespace-bug|unclosed-quotes-in-heading|bogus-image-options|fostered|misnested-tag|multi-colon-escape|missing-end-tag|obsolete-tag|stripped-tag
- lntlimit
Number of results to query
- No more than 500 (5,000 for bots) allowed.
- Type: integer or max
- Default: 10
- lntnamespace
Only include lint errors from the specified namespaces
- Values (separate with | or alternative): 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 90, 91, 92, 93, 100, 101, 102, 103, 104, 105, 106, 107, 486, 487, 828, 829, 1198, 1199, 2300, 2301, 2302, 2303, 2600, 5500, 5501
- To specify all values, use *.
- lntpageid
Only include lint errors from the specified page IDs
- Type: list of integers
- Separate values with | or alternative. Maximum number of values is 50 (500 for bots).
- lntfrom
Lint ID to start querying from
- Type: integer
- Get all lint errors of the obsolete-tag category
- api.php?action=query&list=linterrors&lntcategories=obsolete-tag [open in sandbox]
Linter categories[edit]
A list of linter categories is available in site info properties.
See also[edit]
| This extension is being used on one or more Wikimedia projects. This probably means that the extension is stable and works well enough to be used by such high-traffic websites. Look for this extension's name in Wikimedia's CommonSettings.php and InitialiseSettings.php configuration files to see where it's installed. A full list of the extensions installed on a particular wiki can be seen on the wiki's Special:Version page. |