1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-22 06:42:41 +01:00

Allow .arclint to configure max line length of text linter

Test Plan:
Verified manually. Something like this in .arclint:

  "linters" : {
    "text" : {
      "type" : "text",
      "include" : "(\\.(txt|py|html?)$)",
      "text.max-line-length": 200
    }

changes the line length. Something other than an integer there raises an error.

Reviewers: epriestley, #blessed_reviewers, #arcanist

Reviewed By: epriestley, #blessed_reviewers, #arcanist

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D9029
This commit is contained in:
Phil Frost 2014-05-09 11:31:58 -07:00 committed by epriestley
parent 441e516104
commit 88bb9909b9

View file

@ -23,11 +23,29 @@ final class ArcanistTextLinter extends ArcanistLinter {
return 0.5;
}
public function getLinterConfigurationOptions() {
$options = array(
'text.max-line-length' => 'optional int',
);
return $options + parent::getLinterConfigurationOptions();
}
public function setMaxLineLength($new_length) {
$this->maxLineLength = $new_length;
return $this;
}
public function setLinterConfigurationValue($key, $value) {
switch ($key) {
case 'text.max-line-length':
$this->setMaxLineLength($value);
return;
}
return parent::setLinterConfigurationValue($key, $value);
}
public function getLinterName() {
return 'TXT';
}