Wikipedia:WPCleaner/Linter
WPCleaner – 2.05 (August 26, 2022 ) [±] | ||||
---|---|---|---|---|
WPCleaner
General information about WPCleaner |
Discussion
Discuss the application |
Typos
Suggestions for spelling and typography |
FAQ
Frequently asked questions |
Installation
Install instructions |
Bug report or feature request · History of changes · Configuration (help, template) · Wikis · Languages · Users · Screenshots |
The Linter extension is a MediaWiki extension that identifies wikitext patterns that must or can be fixed in pages along with some guidance about what the issues are with those patterns and how to fix them. The lists of problems found by the extension are available through Special:LintErrors.
WPCleaner 2 includes several features to work with Linter and to help fixing the problems detected by the extension:
- Retrieve the list of pages where a given type of problem has been found by Linter.
- Retrieve the list of problems found by Linter on a page currently being worked on in WPCleaner.
- Direct detection by WPCleaner for some kind of problems that Linter can find (requires some configuration).
Note: Before being able to use WPCleaner on any wiki, you need to properly configure it first.
How to list pages having a given type of problem
[edit]If you wish to get a list of pages that have been reported by Linter for a given type of problem, go to WPCleaner main window, and click on Linter categories and then navigate in the menu that appears : you can select whether or not you wish to include the templates through errors are detected, and the namespaces you're interested in (all or one). WPCleaner then retrieves the requested list (it can take a few minutes depending on the limits you have set on the number of pages and the size of Linter category), and displays it.
TODO: Insert screenshot of Automatic fixing
From the list, you can then fix the problems manually, or use the Automatic fixing feature (only a few types of problems can be fixed that way, and it doesn't work for all errors). If you use the automatic fixing feature, be sure to check what WPCleaner is doing (I have tested it on French Wikipedia, but there's no guarantee that it's error free).
How to list all problems of a given page
[edit]TODO: Insert screenshot of Linter analysis
When you analyze a page, you can use the Linter button to ask Linter for the current list of problems in the page. It displays a list of problems with their position in the current text. For each of them, if the error is detected directly inside the text of the page, a small magnifying glass allows you to go to the corresponding area in the text.
For complex cases involving templates, finding the cause of the problem may not be easy due to multiple templates inclusion. One way to help is to do the following:
- When analyzing a page, use the menu Tools / Expand templates
- A new window is displayed showing both the original text and a version where all templates have been expanded
- In the analysis window, replace the original text with the version where all templates have been expanded into the page analysis window
- Ask Linter to analyze again the page using the Linter button , it should show you where the error is in the expanded version of the page
- Hopefully, this will help you understand from where the error is coming
For example, this method helped me understand on template Ligne adriatique that the *
at the beginning of some parameters resulted in wiki list put inside a <span>...</span>
tag which triggered a missing-end-tag
error. I simply used an other way for displaying the information.
Configuration
[edit]WPCleaner can directly detect several kinds of problems that Linter detects, provided that the configuration has been properly done. Each kind of problem that WPCleaner can detect is assigned to a Check Wiki error number (for example, error #532 is available for missing-end-tag, see explanations).
By default, these errors are inactive, they need to be activated in Check Wiki configuration file.