Extension:Linter
Stav rozšíření: stabilní |
|
|---|---|
| Implementace | Speciální stránka |
| Popis | Odhaluje a sleduje chyby lintů |
| Autoři | Kunal Mehta (Legoktmdiskuse) |
| Zásady kompatibility | Vydání snímků současně s MediaWiki. Hlavní vývojová větev není zpětně kompatibilní. |
| Změny v databázi | Ano |
|
|
| Licence | GNU General Public License 2.0 nebo novější |
| Stáhnout | README |
| Nápověda | Help:Extension:Linter/cs |
| Přeložte rozšíření Linter, používá-li lokalizaci z translatewiki.net | |
| Problémy | Otevřené úkoly · Nahlásit chybu |
Rozšíření Linter sleduje chyby lint z externí služby. V současné době je hlavním případem použití sledování chyb identifikovaných funkcí Parsoid a jejich zpřístupnění editorům. Pomoc pro uživatele, kteří chtějí opravit chyby, je k dispozici na Nápověda:Rozšíření:Linter.
Instalace
- Stáhněte soubor/y a vložte je do adresáře pojmenovaného
Linterve vaší složceextensions/.
Vývojáři a přispěvatelé kódu by si místo toho měli nainstalovat rozšíření from Git pomocí:cd extensions/ git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/Linter
- Na konec vašeho souboru LocalSettings.php přidejte následující kód:
wfLoadExtension( 'Linter' );
- Spusťte aktualizační skript, který automaticky provede všechny nezbytné databázové změny, jaké rozšíření vyžaduje. Přidejte navrhovanou konfiguraci:
Dokončeno – Přejděte na stránku Special:Version vaší wiki a zkontrolujte, zda bylo rozšíření úspěšně nainstalováno.
Konfigurace
Přidejte do souboru LocalSettings.php následující kód a v případě potřeby jej upravte:
// Načíst Parsoid
wfLoadExtension(
'Parsoid',
"$IP/vendor/wikimedia/parsoid/extension.json"
);
$wgParsoidSettings = [
'useSelser' => true,
'linting' => true
];
$wgVisualEditorParsoidAutoConfig = false; // aby fungovalo odstraňování lintigování
$wgVirtualRestConfig = [
'paths' => [],
'modules' => [
'parsoid' => [
'url' => 'https://www.mysite.wiki/w/rest.php',
'domain' => 'www.mysite.wiki',
'forwardCookies' => true,
'restbaseCompat' => false,
'timeout' => 30
],
],
'global' => [
'timeout' => 360,
'forwardCookies' => false,
'HTTPProxy' => null
]
];
Aktualizace na MediaWiki 1.43.x
Updating the extension's database table for MediaWiki 1.43 may need special attention.[1]
Skript update.php spouští dva časově náročné migrační skripty, které aktualizují databázovou tabulku Linteru rychlostí přibližně 500 řádků za sekundu.
Doporučuje se spustit přímo update.php.
Pro velké tabulky Linter, kde není proveditelná delší doba údržby:
- Aktualizace z verze 1.40+
- Podívejte se na stránku
$wgLinterWriteNamespaceColumnStage = true - Podívejte se na stránku
$wgLinterWriteTagAndTemplateColumnsStage = true - Spusťte
$ path/to/mediawiki/maintenance/run.php migrateNamespace - Spusťte
$ path/to/mediawiki/maintenance/run.php migrateTagTemplate - Pokračujte s aktualizací MediaWiki a rozšíření na verzi 1.43
- Aktualizace z verze 1.39 nebo starší
- Nejprve aktualizujte na MediaWiki 1.42
- Pak postupujte podle výše uvedených kroků pro aktualizaci na verzi 1.40+.
API
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): bogus-image-options, deletable-table-tag, duplicate-ids, empty-heading, fostered, fostered-transparent, html5-misnesting, large-tables, misc-tidy-replacement-issues, misnested-tag, missing-end-tag, missing-end-tag-in-heading, multi-colon-escape, multiline-html-table-in-list, multiple-unclosed-formatting-tags, night-mode-unaware-background-color, obsolete-tag, pwrap-bug-workaround, self-closed-tag, stripped-tag, template-arg-in-extension-tag, tidy-font-bug, tidy-whitespace-bug, unclosed-quotes-in-heading, wikilink-in-extlink
- Default: deletable-table-tag|duplicate-ids|html5-misnesting|misc-tidy-replacement-issues|multiline-html-table-in-list|multiple-unclosed-formatting-tags|pwrap-bug-workaround|self-closed-tag|template-arg-in-extension-tag|tidy-font-bug|tidy-whitespace-bug|unclosed-quotes-in-heading|bogus-image-options|fostered|misnested-tag|multi-colon-escape|wikilink-in-extlink|empty-heading|missing-end-tag|missing-end-tag-in-heading|night-mode-unaware-background-color|obsolete-tag|stripped-tag
- lntlimit
Number of results to query
- Type: integer or max
- The value must be between 1 and 500.
- 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, 710, 711, 828, 829, 1198, 1199, 1728, 1729, 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 clients that are allowed higher limits).
- lnttitle
Only include lint errors from the specified page title
- 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]
meta=linterstats (lntrst)
- This module requires read rights.
- Source: Linter
- License: GPL-2.0-or-later
Get number of lint errors in each category
- Get number of lint errors in each category
- api.php?action=query&meta=linterstats [open in sandbox]
Kategorie Linteru
Seznam kategorií linteru je k dispozici ve vlastnostech informací o webu.
Bootstrap nebo přepracování všech stránek
Místo spuštění refreshLinks.php je možné naplnit chyby lint přímým dotazem na parsoid. Příklad skriptu naleznete v phab:T161556#3184216.
Speciální stránky
The extension provides the Special:LintErrors page.
Configuring available lints
The Special:LintErrors page displays available lints with associated priority that have been defined in the configuration parameter $wgLinterCategories.
Each linter category has the following fields:
- dbid: the unique id associated with the lint category used in the database.
- enabled: whether the lint rule is enabled. If lints are disabled they will not be accessible from the special page.
- priority: either none, low, medium or high. Lints that are none will not be listed on Special:LintErrors but will be accessible through the web via the associated subpage.
- no-params: no parameters are associated with the lint category.
- has-name: indicates that the lints are expected to contain a
nameparameter, so the special page displays the column in the UI.
For new lints, it is recommended that by default they are defined as priority none and that they are promoted after testing and some discussion with the linting community. No formal process exists for promoting lint priorities at time of writing.
References
| Toto rozšíření se používá na jednom nebo více projektech Wikimedia. Pravděpodobně to znamená, že rozšíření je stabilní a funguje dostatečně dobře, aby jej mohly používat weby s tak vysokou návštěvností. Vyhledejte tento název rozšíření v konfiguračních souborech CommonSettings.php a InitialiseSettings.php Wikimedie, abyste viděli, kde je nainstalováno. Úplný seznam rozšíření nainstalovaných na konkrétní wiki lze vidět na stránce wiki Special:Version. |
| Toto rozšíření je zahrnuto v následujících wiki farmách/hostitelích a/nebo balíčcích: |
- Stable extensions/cs
- Special page extensions/cs
- APIQuerySiteInfoGeneralInfo extensions/cs
- BeforePageDisplay extensions/cs
- InfoAction extensions/cs
- LoadExtensionSchemaUpdates extensions/cs
- PageDeletionDataUpdates extensions/cs
- ParserLogLinterData extensions/cs
- RevisionDataUpdates extensions/cs
- WgQueryPages extensions/cs
- GPL licensed extensions/cs
- Extensions in Wikimedia version control/cs
- All extensions/cs
- Extensions bundled with MediaWiki 1.40/cs
- Extensions used on Wikimedia/cs
- Extensions included in Canasta/cs
- Extensions available as Debian packages/cs
- Extensions included in Miraheze/cs
- Extensions included in MyWikis/cs
- Extensions included in Telepedia/cs
- Extensions included in Weird Gloop/cs
- Extensions included in wiki.gg/cs
