Extension:Linter

This page is a translated version of the page Extension:Linter and the translation is 69% complete.
この拡張機能は MediaWiki 1.40 以降に同梱されています。 そのため再度ダウンロードする必要はありません。 しかし、提供されているその他の手順に従う必要はあります。
MediaWiki 拡張機能マニュアル
Linter
リリースの状態: 安定
実装 特別ページ
説明 lint のエラーを可視化して追跡
作者 Kunal Mehta (Legoktmトーク)
MediaWiki >= 1.42
データベースの変更 はい
テーブル linter
ライセンス GNU 一般公衆利用許諾書 2.0 以降
ダウンロード
README
ヘルプ Help:Extension:Linter/ja
  • $wgLinterUseNamespaceColumnStage
  • $wgLinterCategories
  • $wgLinterStatsdSampleFactor
  • $wgLinterUserInterfaceTagAndTemplateStage
  • $wgLinterWriteTagAndTemplateColumnsStage
  • $wgLinterWriteNamespaceColumnStage
Quarterly downloads 54 (Ranked 91st)
Public wikis using 884 (Ranked 294th)
translatewiki.net で翻訳を利用できる場合は、Linter 拡張機能の翻訳にご協力ください
問題点 未解決のタスク · バグを報告

Linter 拡張機能は外部サービスを用いて lint のエラーを追跡します。 現状では主に Parsoid が検出したエラーを追跡し編集者に可視化するため使われています。 エラー修正に取り組むにはHelp:Extension:Linter のヘルプを参照してください。

インストール

この拡張機能は、Parsoid の構成で linting が有効になっていることを必要とします。
  • ダウンロードして、ファイルをextensions/フォルダー内のLinterという名前のディレクトリ内に配置します。
    開発者とコード寄稿者は、上記の代わりに以下を使用してGitからインストールします:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/Linter
  • 以下のコードを LocalSettings.php ファイルの末尾に追加します:
    wfLoadExtension( 'Linter' );
    
  • 更新スクリプトを実行します。このスクリプトは、この拡張機能が必要とするデータベーステーブルを自動的に作成します。
  •   完了 – ウィキの「Special:Version」に移動して、拡張機能が正しくインストールされたことを確認します。

設定パラメター

Be warned that this config is not sufficient to get lints run or linter errors reported as of February 2024. There may be missing documentation.

In the $wgParsoidSettings section of your LocalSettings.php file, set

$wgParsoidSettings = [
    'linting' => true
];


API

list=linterrors (lnt)

(main | query | linterrors)

Get a list of lint errors

Specific parameters:
Other general parameters are available.
lntcategories

Categories of lint errors

Values (separate with | or alternative): bogus-image-options, deletable-table-tag, fostered, 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, tidy-font-bug, tidy-whitespace-bug, unclosed-quotes-in-heading, wikilink-in-extlink
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|wikilink-in-extlink|missing-end-tag|missing-end-tag-in-heading|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, 486, 487, 710, 711, 828, 829, 1198, 1199, 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
Example:
Get all lint errors of the obsolete-tag category
api.php?action=query&list=linterrors&lntcategories=obsolete-tag [open in sandbox]

meta=linterstats (lntrst)

(main | query | linterstats)

Get number of lint errors in each category


Example:
Get number of lint errors in each category
api.php?action=query&meta=linterstats [open in sandbox]


Linter のカテゴリ

Linter のカテゴリはサイト情報プロパティにまとめてあります。

Bootstrap or reprocess all pages

Instead of running refreshLinks.php , it's possible to populate lint errors by querying parsoid directly. See phab:T161556#3184216 for an example script.

Special pages