Extension:Linter/ja
![]() リリースの状態: 安定Category:Stable extensions/ja |
|
---|---|
![]() |
|
実装 | 特別ページCategory:Special page extensions/ja |
説明 | lint のエラーを可視化して追跡 |
作者 | Kunal Mehta (Legoktmトーク) |
MediaWiki | >= 1.45 |
データベースの変更 | はい |
テーブル | linter |
ライセンス | GNU 一般公衆利用許諾書 2.0 以降 |
ダウンロード | Category:Extensions in Wikimedia version control/ja README |
ヘルプ | Help:Extension:Linter/ja |
|
|
|
|
translatewiki.net で翻訳を利用できる場合は、Linter 拡張機能の翻訳にご協力ください | |
問題点 | 未解決のタスク · バグを報告 |
Linter 拡張機能は外部サービスを用いて lint のエラーを追跡します。 現状では主に Parsoid が検出したエラーを追跡し編集者に可視化するため使われています。 エラー修正に取り組むにはHelp:Extension:Linter のヘルプを参照してください。
インストール
- ダウンロードして、ファイルを
extensions/
フォルダー内のLinter
という名前のディレクトリ内に配置します。
開発者とコード寄稿者は、上記の代わりに以下を使用してGitからインストールします:cd extensions/ git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/Linter
- 以下のコードを LocalSettings.php ファイルの末尾に追加します:
wfLoadExtension( 'Linter' );
- 更新スクリプトを実行します。このスクリプトは、この拡張機能が必要とするデータベーステーブルを自動的に作成します。 指定の設定を追加:
完了 – ウィキの「Special:Version」に移動して、拡張機能が正しくインストールされたことを確認します。
設定
自分の LocalSettings.php ファイルに以下を追加、必要に応じて細部を編集します:
// Load Parsoid
wfLoadExtension(
'Parsoid',
"$IP/vendor/wikimedia/parsoid/extension.json"
);
$wgParsoidSettings = [
'useSelser' => true,
'linting' => true
];
$wgVisualEditorParsoidAutoConfig = false; // to make linting work
$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
]
];
MediaWiki 1.43.x にアップグレード
Updating the extension's database table for MediaWiki 1.43 may need special attention.[1]
The "update.php" script runs two time-consuming migration scripts that update the Linter database table at approximately 500 rows per second. Running "update.php" directly is recommended.
For large Linter tables where extended maintenance time is not feasible:
- Upgrading from 1.40+
- Set
$wgLinterWriteNamespaceColumnStage = true
- Set
$wgLinterWriteTagAndTemplateColumnsStage = true
- Run
$ path/to/mediawiki/maintenance/run.php migrateNamespace
- Run
$ path/to/mediawiki/maintenance/run.php migrateTagTemplate
- Proceed with MediaWiki and extensions update to 1.43
- Upgrading from 1.39 or earlier
- Update to MediaWiki 1.42 first
- Then follow steps above for 1.40+ upgrade
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, 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|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, 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]
Linter のカテゴリ
Linter のカテゴリはサイト情報プロパティにまとめてあります。
ブートストラップまたは 全てのページを再処理
refreshLinks.php を走らせる代わりに、直接、parsoid にクエリをかけるとリントエラーを埋めることができます。 スクリプトの例は phab:T161556#3184216 を参照。
特別ページ
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
name
parameter, 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
![]() | この拡張機能は 1 つ以上のウィキメディアのプロジェクトで使用されています。 これはおそらく、この拡張機能が安定していて高いトラフィックのウェブサイトでも十分に動作することを意味します。 この拡張機能がインストールされている場所を確認するには、ウィキメディアの設定ファイル CommonSettings.php および InitialiseSettings.php 内で、この拡張機能の名前を探してください。 特定のウィキにインストールされている拡張機能の完全な一覧は、そのウィキの Special:Version ページにあります。 |
![]() | この拡張機能は以下のウィキ ファーム/ウィキ ホスト/パッケージに含まれています:
|