Page MenuHomePhabricator

Support API query for list of errors for arbitrary wikitext (for pre-save checks)
Open, Needs TriagePublic

Description

To be able to integrate the Linter extension with external tools helping fixing problems in Wikipedia articles, I think it would be very interesting to have an API query that can give the list of errors for a given page, and to be able also to provide with the query the current version of the text of the article (so that you can check before saving a new version of an article what errors wills be reported by Linter)

And bonus, provide an icon (scalable if possible) to be used by the external tools for Linter related stuff ;-)

Event Timeline

NicoV created this task.Dec 13 2016, 10:48 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptDec 13 2016, 10:48 AM
Aklapper renamed this task from Linter extension : API query for list of errors for a given page to Support API query for list of errors for a given page.Dec 13 2016, 12:50 PM

If we add a prop=linterrors I think that should work out the best. Then you can retrieve the current revision text plus hte errors with prop=revisions|linterrors or something.

NicoV added a comment.Apr 16 2017, 2:42 PM

@Legoktm : what I meant by the "current version of the text" is not necessarily the one saved in the wiki, but the rather the current version in the external tool or in the edit box, so that a user that is modifying an article can check what errors are still there before saving the new version of the text.

What would be nice is an API call that takes a page name (or page id), an optional page contents and sends back a list of errors detected by Linter for the provided page contents (if not provided, then linter will use the last version of the article as a base for analysis).
If you can't give Linter the text to analyse, it will limit a lot the usefulness of tools to fix errors detected by Linter

This won't be a "query" api, but an "action" api (like action=parse).

T163072: Option to Do Linter/Parsoid syntax check during "Check Preview" from edit-form. (for admins and template editors etc.) has also been requested -- related, probably not the same, in case lint errors are presented in the returned HTML from the preview of the old wikitext editor

Ah, understood. OK, I'll rephrase the title.

Legoktm renamed this task from Support API query for list of errors for a given page to Support API query for list of errors for arbitrary wikitext (for pre-save checks).Apr 17 2017, 3:10 AM

@Ciencia_Al_Poder :

When attempting a fix for an indentified Linter issue it would be nice to know you haven't introduced a new one, or that you were not going to introduce one by adding new content. It would be nice not to introduce 'badly' structured content before it even gets saved to the wiki. Fixing up existing pages is a major task as it is, without it being a moving target.

And apologies for only just finding this.