Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F17745826
D10512.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D10512.id.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Jul 22 2025, 6:58 PM (23 w, 5 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
8550350
Default Alt Text
D10512.id.diff (1 KB)
Attached To
Mode
D10512: Adding configurability for flake8
Attached
Detach File
Event Timeline
Log In to Comment