Jump to content

Extension:린터

From mediawiki.org
This page is a translated version of the page Extension:Linter and the translation is 44% complete.
Outdated translations are marked like this.
This extension comes with MediaWiki 1.40 and above. 따라서 다시 다운로드하지 않아도 됩니다. 하지만 여전히 제공되는 별개의 지침을 따라야 합니다.
미디어위키 확장 기능 설명서
Linter
출시 상태: 안정
구현 특수 문서
설명 린트 오류를 노출시키고 추적합니다
만든 이 Kunal Mehta (Legoktm토론)
MediaWiki >= 1.43
데이터베이스 변경
테이블 linter
라이선스 GNU General Public License 2.0 or later
다운로드
README
  • $wgLinterCategories
  • $wgLinterParseOnDerivedDataUpdate
  • $wgLinterStatsdSampleFactor
Quarterly downloads 63 (Ranked 72nd)
Public wikis using 884 (Ranked 294th)
Linter 확장 기능 번역 (translatewiki.net에서 가능한 경우)
이슈 미해결 작업 · 버그 보고

린터 확장 기능은 외부 서비스로부터 린트 오류를 추적합니다. 현재 주된 이용 목적은 Parsoid가 식별한 오류를 추적한 다음 이것들을 편집자에게 표시해주는 것입니다. 오류 수정을 원하는 사용자를 위한 도움말은 Help:Extension:Linter 에서 볼 수 있습니다.

설치

This extension requires linting enabled in Parsoid's configuration.
  • 파일을 다운로드하고 Linter 폴더를 extensions/ 디렉토리에 넣어 주세요.
    개발자와 코딩 기여자는 Git을 이용해 확장기능을 다운받는 것이 좋습니다.cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/Linter
  • 아래의 코드를 LocalSettings.php 코드의 마지막에 추가합니다.
    wfLoadExtension( 'Linter' );
    
  • 갱신 스크립트를 실행합니다. 이 스크립트는 이 확장기능을 필요로 하는 데이터 베이스 테이블을 자동적으로 작성합니다.Add the suggested configuration:
  • Yes 완료 – 위키의 ‘Special:Version’에 이동해서, 확장기능이 올바르게 설치된 것을 확인합니다.

구성 변수

Add the following to your LocalSettings.php file, editing as necessary:

// 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
	]
];

Upgrading to 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+
  1. Set $wgLinterWriteNamespaceColumnStage = true
  2. Set $wgLinterWriteTagAndTemplateColumnsStage = true
  3. Run $ path/to/mediawiki/maintenance/run.php migrateNamespace
  4. Run $ path/to/mediawiki/maintenance/run.php migrateTagTemplate
  5. Proceed with MediaWiki and extensions update to 1.43
Upgrading from 1.39 or earlier
  1. Update to MediaWiki 1.42 first
  2. Then follow steps above for 1.40+ upgrade


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, duplicate-ids, 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|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, 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]


린터 분류

린터 분류 목록은 사이트 정보 속성에서 볼 수 있습니다.

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

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