Aide:Extension:Linter

From MediaWiki.org
Jump to navigation Jump to search
This page is a translated version of the page Help:Extension:Linter and the translation is 50% complete.

Outdated translations are marked like this.
Other languages:
English • ‎español • ‎français • ‎polski • ‎português do Brasil • ‎українська • ‎中文 • ‎日本語

L'extension Linter identifie les éléments dans le wikitexte qui devraient ou pourraient être corrigés dans les pages, ainsi que quelques consignes sur les problèmes que forment ces patterns, et sur la manière de les résoudre.

La page Special:LintErrors rassemble les erreurs par type. Plusieurs de ces problèmes seront peut-être plus facile à identifier avec Special:Expandtemplates. Sur cette page, vous trouverez les problèmes de lint classés selon la dangerosité des problèmes en regard aux buts qui ne sont pas atteints à cause de ces problèmes. Les informations et la discussion sur ces points seront développés plus bas.

Nous allons continuer à améliorer les fonctionnalités d'élimination du bruit, à résoudre les bugs et à rendre le résultat de l'outil plus facile à utiliser, mais le rendu actuel est déjà prêt à l'emploi et utilisable.

Problèmes à priorité haute

deletable-table-tag

Help:Extension:Linter/deletable-table-tag

pwrap-bug-workaround

Help:Extension:Linter/pwrap-bug-workaround

self-closed-tag

Help:Extension:Linter/self-closed-tag

tidy-whitespace-bug

Help:Extension:Linter/tidy-whitespace-bug

html5-misnesting

Help:Extension:Linter/html5-misnesting

tidy-font-bug

Help:Extension:Linter/tidy-font-bug

multiple-unclosed-formatting-tags

Help:Extension:Linter/multiple-unclosed-formatting-tags

multiline-html-table-in-list

Help:Extension:Linter/multiline-html-table-in-list

unclosed-quote-in-heading

Help:Extension:Linter/unclosed-quote-in-heading

misc-tidy-replacement-issues

Help:Extension:Linter/misc-tidy-replacement-issues

Problèmes à priorité moyenne

bogus-image-options

Help:Extension:Linter/bogus-image-options

fostered

Help:Extension:Linter/fostered

misnested-tag

Help:Extension:Linter/misnested-tag

multi-colon-escape

Help:Extension:Linter/multi-colon-escape

Problèmes à priorité basse

missing-end-tag

Help:Extension:Linter/missing-end-tag

stripped-tag

Help:Extension:Linter/stripped-tag

obsolete-tag

Aide:Extension:Linter/obsolete-tag

Pourquoi et comment corriger

Par la suite, l'équipe chargée du parseur prévoit d'améliorer l'extension Linter pour qu'elle identifie les éléments de wikitexte :

  • qui sont faux (ex : les options d'image fausse - souvent à cause d'une typo ou parce que les options de MediaWiki pour parseur les images sont fragiles)
  • qui sont désuets (ex : balises auto-fermantes)
  • qui peuvent être brisés à cause de changements dans les tubes (ex : replacement de Tidy par RemexHTML)
  • qui ne sont plus valides en HTML5 (ex : balises obsolètes telles que center, font, tt)
  • qui sont potentiellement cassés et pourraient être mal interprétés par le parseur en les comparant à ce que l'éditeur souhaitait qu'elles fasse (ex: balises HTML non-fermées, mauvaise inclusion de balises HTML)

Toutes ces erreurs ne nécessitent pas d'être réglées rapidement, sinon jamais (selon votre tolérance au lint). Différents objectifs sont visés à travers les différentes sous-types de problèmes de lint détaillés ci-dessus. Nous (l'équipe chargée du parseur) allons essayer d'être transparents à propos de ces objectifs et nous proposerons des conseils sur les objectifs qui correspondent à la résolution chaque problèmes.

Des instructions simplifiées sont proposées sur la page de FAQ.

Objectif : Remplacer Tidy

As part of addressing technical debt in the parsing pipeline of MediaWiki, we replaced Tidy with a HTML5-based tool. However, doing so would have broken the rendering of a small subset of pages unless certain wikitext patterns were fixed. Specifically, issues found in the deletable-table-tag, pwrap-bug-workaround, self-closed-tag, tidy-whitespace-bug, html5-misnesting, and tidy-font-bug categories. In order to do a timely replacement of Tidy, we classified all these issues as high priority.

Verifying fixes for these lint categories

You can verify the fixes for these lint categories via the ParserMigration extension. If you enable "ParserMigration" in your preferences, a link will be added to the toolbox of all articles ("Edit with migration tool"). If you edit the wikitext for a page with this link, the preview will show you current output (Tidy) and new output (RemexHTML, the Tidy replacement) side-by-side and check how your edit changes the rendering.

Objectif : Améliorer la conformité de rendu entre le parseur PHP et Parsoid

Right now, the HTML generated by the PHP parser is used for read views and the HTML generated by Parsoid is used by editing tools and the Android app among others. The parsing team, as one of its long-term objectives, wants to enable the use of Parsoid's output for both read views as well as for editing. Since Parsoid and RemexHTML are both HTML5-based tools, the lint categories that affect RemexHTML's rendering also affect Parsoid's rendering. We haven't yet identified any newer lint issues that affect Parsoid's rendering at this time, but will update this list as we identify any such.

Objectif : respecter le standard HTML5

This is a somewhat complex goal and we haven't yet arrived at an understanding about how important it is to pursue this goal or how far we should go with this. Additionally, it is not yet clear what mechanisms we wish to leverage towards this goal. For example, based on a bunch of discussions in different venues, User:Legoktm/HTML+MediaWiki outlines a proposal for handling the html5-deprecated big tag. In any case, fixing issues in the obsolete-tag, self-closed-tag categories advance this goal. Given lack of clarity around this goal, we have accordingly marked the obsolete-tag category as a low-priority goal.

Objectif : Clarifier les intentions des éditeurs

Getting markup right is hard. Errors inadvertently creep through. While the parser does its best in recovering from these errors, in many cases, what the parser does might not truly reflect the editor's original intent. Given that, we recommend that it is best to fix the issues identified here to clarify the editor's intention. Issues in the bogus-image-options, fostered-content, misnested-tag, missing-end-tag categories seem to affect this goal. Since this is a fairly important goal, we have marked most of them with medium priority. However, we have marked the missing-end-tag category with a low priority since in a vast majority of cases, the parser does seem to recover fairly accurately. Nevertheless, we recommend fixing whatever can be fixed without too much effort, if only to assist comprehension by other human editors and tools.

Objectif : Nettoyer le balisage

Getting markup right is hard. Even in the presence of errors, the parser does a fairly decent job in most cases in figuring out accurately how that piece of markup is supposed to render. But, in much the same way that typos, punctuation and minor grammatical errors can feel unsettling, some editors or those with a developer-mindset might find lint issues in these categories unsettling. We don't recommend spending an inordinate amount of time fixing these issues and, in many scenarios, bots might be able to fix these up as well. misnested-tag, missing-end-tag, stripped-tag lint categories affect this goal.


FAQ

When are lint errors for a page updated?

Currently, all lint categories are populated by errors identified by Parsoid while parsing a page. When a page (or, template transcluded on a page) is edited, ChangeProp requests a re-parse of that page from Parsoid, which will send the fresh results to the Linter extension.

This means that when a new category is introduced (or a correction is made to a previous category), it may take a while for all the results to be updated (if ever for pages that are rarely touched). Making a null edit would speed up the process individually. However, in phab:T161556, we're exploring ways to reprocess all pages.

Should pages in X namespace (e.g. talk) be fixed

The priority is content namespaces. The rest largely depend on the wiki. A lot of pages are used as a sandbox, and as such deliberately contain errors.

Tools

Voir aussi