Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14035877
D8385.id19934.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
7 KB
Referenced Files
None
Subscribers
None
D8385.id19934.diff
View Options
Index: src/lint/linter/ArcanistCSSLintLinter.php
===================================================================
--- src/lint/linter/ArcanistCSSLintLinter.php
+++ src/lint/linter/ArcanistCSSLintLinter.php
@@ -23,23 +23,15 @@
}
public function getDefaultFlags() {
- $config = $this->getEngine()->getConfigurationManager();
-
- $options = $config->getConfigFromAnySource('lint.csslint.options');
// TODO: Deprecation warning.
-
- return $options;
+ $config = $this->getEngine()->getConfigurationManager();
+ return $config->getConfigFromAnySource('lint.csslint.options');
}
public function getDefaultBinary() {
// TODO: Deprecation warning.
$config = $this->getEngine()->getConfigurationManager();
- $bin = $config->getConfigFromAnySource('lint.csslint.bin');
- if ($bin) {
- return $bin;
- }
-
- return 'csslint';
+ return $config->getConfigFromAnySource('lint.csslint.bin', 'csslint');
}
public function getInstallInstructions() {
Index: src/lint/linter/ArcanistCSharpLinter.php
===================================================================
--- src/lint/linter/ArcanistCSharpLinter.php
+++ src/lint/linter/ArcanistCSharpLinter.php
@@ -64,14 +64,6 @@
return parent::setCustomSeverityMap($map);
}
- public function getLintSeverityMap() {
- return array();
- }
-
- public function getLintNameMap() {
- return array();
- }
-
/**
* Determines what executables and lint paths to use. Between platforms
* this also changes whether the lint engine is run under .NET or Mono. It
Index: src/lint/linter/ArcanistCppcheckLinter.php
===================================================================
--- src/lint/linter/ArcanistCppcheckLinter.php
+++ src/lint/linter/ArcanistCppcheckLinter.php
@@ -10,10 +10,6 @@
*/
final class ArcanistCppcheckLinter extends ArcanistLinter {
- public function willLintPaths(array $paths) {
- return;
- }
-
public function getLinterName() {
return 'cppcheck';
}
@@ -21,11 +17,9 @@
public function getLintOptions() {
$config = $this->getEngine()->getConfigurationManager();
// You will for sure want some options. The below default tends to be ok
- $options = $config->getConfigFromAnySource(
+ return $config->getConfigFromAnySource(
'lint.cppcheck.options',
'-j2 --inconclusive --enable=performance,style,portability,information');
-
- return $options;
}
public function getLintPath() {
@@ -42,9 +36,7 @@
"globally, you can just remove these keys from your .arcconfig.");
}
- $bin = csprintf("%s/%s", $prefix, $bin);
-
- return $bin;
+ return csprintf("%s/%s", $prefix, $bin);
}
// Look for globally installed cppcheck
Index: src/lint/linter/ArcanistCpplintLinter.php
===================================================================
--- src/lint/linter/ArcanistCpplintLinter.php
+++ src/lint/linter/ArcanistCpplintLinter.php
@@ -9,19 +9,13 @@
*/
final class ArcanistCpplintLinter extends ArcanistLinter {
- public function willLintPaths(array $paths) {
- return;
- }
-
public function getLinterName() {
return 'cpplint.py';
}
public function getLintOptions() {
$config = $this->getEngine()->getConfigurationManager();
- $options = $config->getConfigFromAnySource('lint.cpplint.options', '');
-
- return $options;
+ return $config->getConfigFromAnySource('lint.cpplint.options', '');
}
public function getLintPath() {
@@ -38,9 +32,7 @@
"globally, you can just remove these keys from your .arcconfig.");
}
- $bin = csprintf("%s/%s", $prefix, $bin);
-
- return $bin;
+ return csprintf("%s/%s", $prefix, $bin);
}
// Look for globally installed cpplint.py
Index: src/lint/linter/ArcanistFlake8Linter.php
===================================================================
--- src/lint/linter/ArcanistFlake8Linter.php
+++ src/lint/linter/ArcanistFlake8Linter.php
@@ -18,12 +18,8 @@
public function getDefaultFlags() {
// TODO: Deprecated.
-
$config = $this->getEngine()->getConfigurationManager();
-
- $options = $config->getConfigFromAnySource('lint.flake8.options', '');
-
- return $options;
+ return $config->getConfigFromAnySource('lint.flake8.options', '');
}
public function getDefaultBinary() {
Index: src/lint/linter/ArcanistPEP8Linter.php
===================================================================
--- src/lint/linter/ArcanistPEP8Linter.php
+++ src/lint/linter/ArcanistPEP8Linter.php
@@ -22,15 +22,10 @@
public function getDefaultFlags() {
// TODO: Warn that all of this is deprecated.
-
$config = $this->getEngine()->getConfigurationManager();
- $options = $config->getConfigFromAnySource('lint.pep8.options');
-
- if ($options === null) {
- $options = $this->getConfig('options');
- }
-
- return $options;
+ return $config->getConfigFromAnySource(
+ 'lint.pep8.options',
+ $this->getConfig('options'));
}
public function shouldUseInterpreter() {
Index: src/lint/linter/ArcanistPhpcsLinter.php
===================================================================
--- src/lint/linter/ArcanistPhpcsLinter.php
+++ src/lint/linter/ArcanistPhpcsLinter.php
@@ -49,12 +49,7 @@
public function getDefaultBinary() {
// TODO: Deprecation warnings.
$config = $this->getEngine()->getConfigurationManager();
- $bin = $config->getConfigFromAnySource('lint.phpcs.bin');
- if ($bin) {
- return $bin;
- }
-
- return 'phpcs';
+ return $config->getConfigFromAnySource('lint.phpcs.bin', 'phpcs');
}
public function shouldExpectCommandErrors() {
Index: src/lint/linter/ArcanistPhutilLibraryLinter.php
===================================================================
--- src/lint/linter/ArcanistPhutilLibraryLinter.php
+++ src/lint/linter/ArcanistPhutilLibraryLinter.php
@@ -28,10 +28,6 @@
return 'PHL';
}
- public function getLintSeverityMap() {
- return array();
- }
-
public function willLintPaths(array $paths) {
if (!xhpast_is_available()) {
throw new Exception(xhpast_get_build_instructions());
Index: src/lint/linter/ArcanistPyFlakesLinter.php
===================================================================
--- src/lint/linter/ArcanistPyFlakesLinter.php
+++ src/lint/linter/ArcanistPyFlakesLinter.php
@@ -7,23 +7,10 @@
*/
final class ArcanistPyFlakesLinter extends ArcanistLinter {
- public function willLintPaths(array $paths) {
- return;
- }
-
public function getLinterName() {
return 'PyFlakes';
}
- public function getLintSeverityMap() {
- return array();
- }
-
- public function getLintNameMap() {
- return array(
- );
- }
-
public function getPyFlakesOptions() {
return null;
}
Index: src/lint/linter/ArcanistPyLintLinter.php
===================================================================
--- src/lint/linter/ArcanistPyLintLinter.php
+++ src/lint/linter/ArcanistPyLintLinter.php
@@ -187,22 +187,10 @@
return implode(" ", $options);
}
- public function willLintPaths(array $paths) {
- return;
- }
-
public function getLinterName() {
return 'PyLint';
}
- public function getLintSeverityMap() {
- return array();
- }
-
- public function getLintNameMap() {
- return array();
- }
-
public function lintPath($path) {
$pylint_bin = $this->getPyLintPath();
$python_path = $this->getPyLintPythonPath();
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 11, 7:52 AM (2 d, 21 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6728144
Default Alt Text
D8385.id19934.diff (7 KB)
Attached To
Mode
D8385: Simplified the logic in various functions.
Attached
Detach File
Event Timeline
Log In to Comment