Page MenuHomePhabricator
Diviner Arcanist Tech Docs ArcanistLinterStandard

abstract class ArcanistLinterStandard
Arcanist Technical Documentation (Lint)

A "linter standard" is a collection of linter rules with associated severities and configuration.

Basically, a linter standard allows a set of linter rules and configuration to be easily reused across multiple repositories without duplicating the contents of the .arclint file (and the associated maintenance costs in keeping changes to this file synchronized).

Methods

abstract public function getKey()

Returns a unique identifier for the linter standard.

Return
string

abstract public function getName()

Returns a human-readable name for the linter standard.

Return
string

abstract public function getDescription()

Returns a human-readable description for the linter standard.

Return
string

abstract public function supportsLinter($linter)

Checks whether the linter standard supports a specified linter.

Parameters
ArcanistLinter$linterThe linter which is being configured.
Return
boolTrue if the linter standard supports the specified linter, otherwise false.

public function getLinterConfiguration()

Get linter configuration.

Returns linter configuration which is passed to ArcanistLinter::setLinterConfigurationValue().

Return
map<string, wild>

public function getLinterSeverityMap()

Get linter severities.

Returns linter severities which are passed to ArcanistLinter::addCustomSeverityMap().

Return
map

final public static function getStandard($key, $linter)

Load a linter standard by key.

Parameters
string$key
ArcanistLinter$linter
Return
ArcanistLinterStandard

final public static function loadAllStandards()

Load all linter standards.

Return
list<ArcanistLinterStandard>

final public static function loadAllStandardsForLinter($linter)

Load all linter standards which support a specified linter.

Parameters
ArcanistLinter$linter
Return
list<ArcanistLinterStandard>