mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-11-29 18:22:41 +01:00
Ignore duplicate PEP8 lint errors in comprehensive engine
Test Plan: $ arc lint a.py # with too long line Reviewers: zeeg, epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D3882
This commit is contained in:
parent
a83cb43d08
commit
2e6dcf0fbb
3 changed files with 13 additions and 4 deletions
|
@ -336,4 +336,13 @@ abstract class ArcanistLintEngine {
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function getPEP8WithTextOptions() {
|
||||||
|
// E101 is subset of TXT2 (Tab Literal).
|
||||||
|
// E501 is same as TXT3 (Line Too Long).
|
||||||
|
// W291 is same as TXT6 (Trailing Whitespace).
|
||||||
|
// W292 is same as TXT4 (File Does Not End in Newline).
|
||||||
|
// W293 is same as TXT6 (Trailing Whitespace).
|
||||||
|
return '--ignore=E101,E501,W291,W292,W293';
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,9 @@ final class ComprehensiveLintEngine extends ArcanistLintEngine {
|
||||||
|
|
||||||
$py_paths = preg_grep('/\.py$/', $paths);
|
$py_paths = preg_grep('/\.py$/', $paths);
|
||||||
$linters[] = id(new ArcanistPyFlakesLinter())->setPaths($py_paths);
|
$linters[] = id(new ArcanistPyFlakesLinter())->setPaths($py_paths);
|
||||||
$linters[] = id(new ArcanistPEP8Linter())->setPaths($py_paths);
|
$linters[] = id(new ArcanistPEP8Linter())
|
||||||
|
->setConfig(array('options' => $this->getPEP8WithTextOptions()))
|
||||||
|
->setPaths($py_paths);
|
||||||
|
|
||||||
$linters[] = id(new ArcanistRubyLinter())
|
$linters[] = id(new ArcanistRubyLinter())
|
||||||
->setPaths(preg_grep('/\.rb$/', $paths));
|
->setPaths(preg_grep('/\.rb$/', $paths));
|
||||||
|
|
|
@ -28,9 +28,7 @@ final class ArcanistPEP8Linter extends ArcanistLinter {
|
||||||
$options = $working_copy->getConfig('lint.pep8.options');
|
$options = $working_copy->getConfig('lint.pep8.options');
|
||||||
|
|
||||||
if ($options === null) {
|
if ($options === null) {
|
||||||
// W293 (blank line contains whitespace) is redundant when used
|
$options = $this->getConfig('options');
|
||||||
// alongside TXT6, causing pain to python programmers.
|
|
||||||
return '--ignore=W293';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $options;
|
return $options;
|
||||||
|
|
Loading…
Reference in a new issue