Page MenuHomePhabricator

D10512.id25257.diff
No OneTemporary

D10512.id25257.diff

diff --git a/src/lint/linter/ArcanistFlake8Linter.php b/src/lint/linter/ArcanistFlake8Linter.php
--- a/src/lint/linter/ArcanistFlake8Linter.php
+++ b/src/lint/linter/ArcanistFlake8Linter.php
@@ -6,6 +6,8 @@
*/
final class ArcanistFlake8Linter extends ArcanistExternalLinter {
+ private $flake8rc;
+
public function getInfoName() {
return 'Flake8';
}
@@ -28,6 +30,17 @@
return 'flake8';
}
+ public function getLinterConfigurationOptions() {
+ $options = array(
+ 'flake8.flake8rc' => array(
+ 'type' => 'optional string',
+ 'help' => pht('Eg. ~/config/flake8')
+ )
+ );
+
+ return $options + parent::getLinterConfigurationOptions();
+ }
+
public function getDefaultFlags() {
return $this->getDeprecatedConfiguration('lint.flake8.options', array());
}
@@ -43,6 +56,16 @@
}
}
+ protected function getMandatoryFlags() {
+ $options = array();
+
+ if ($this->flake8rc) {
+ $options[] = '--config='.$this->flake8rc;
+ }
+
+ return $options;
+ }
+
public function getVersion() {
list($stdout) = execx('%C --version', $this->getExecutableCommand());
@@ -54,6 +77,16 @@
}
}
+ public function setLinterConfigurationValue($key, $value) {
+ switch ($key) {
+ case 'flake8.flake8rc':
+ $this->flake8rc = $value;
+ return;
+ }
+
+ return parent::setLinterConfigurationValue($key, $value);
+ }
+
public function getInstallInstructions() {
return pht('Install flake8 using `easy_install flake8`.');
}

File Metadata

Mime Type
text/plain
Expires
Oct 7 2025, 11:03 PM (12 w, 5 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
8550350
Default Alt Text
D10512.id25257.diff (1 KB)

Event Timeline