mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-11-22 14:52:40 +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:
parent
441e516104
commit
88bb9909b9
1 changed files with 18 additions and 0 deletions
|
@ -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';
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue