diff --git a/src/lint/linter/ArcanistCSSLintLinter.php b/src/lint/linter/ArcanistCSSLintLinter.php index 7314025d..1f07a4b9 100644 --- a/src/lint/linter/ArcanistCSSLintLinter.php +++ b/src/lint/linter/ArcanistCSSLintLinter.php @@ -23,23 +23,15 @@ final class ArcanistCSSLintLinter extends ArcanistExternalLinter { } 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() { diff --git a/src/lint/linter/ArcanistCSharpLinter.php b/src/lint/linter/ArcanistCSharpLinter.php index 81d1f360..0d6f3c22 100644 --- a/src/lint/linter/ArcanistCSharpLinter.php +++ b/src/lint/linter/ArcanistCSharpLinter.php @@ -64,14 +64,6 @@ final class ArcanistCSharpLinter extends ArcanistLinter { 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 diff --git a/src/lint/linter/ArcanistCppcheckLinter.php b/src/lint/linter/ArcanistCppcheckLinter.php index 33b9f490..471a24ca 100644 --- a/src/lint/linter/ArcanistCppcheckLinter.php +++ b/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 @@ final class ArcanistCppcheckLinter extends ArcanistLinter { 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 @@ final class ArcanistCppcheckLinter extends ArcanistLinter { "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 diff --git a/src/lint/linter/ArcanistCpplintLinter.php b/src/lint/linter/ArcanistCpplintLinter.php index e13d3fcb..b2eeca85 100644 --- a/src/lint/linter/ArcanistCpplintLinter.php +++ b/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 @@ final class ArcanistCpplintLinter extends ArcanistLinter { "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 diff --git a/src/lint/linter/ArcanistFlake8Linter.php b/src/lint/linter/ArcanistFlake8Linter.php index a7ed986a..01ecd49c 100644 --- a/src/lint/linter/ArcanistFlake8Linter.php +++ b/src/lint/linter/ArcanistFlake8Linter.php @@ -18,12 +18,8 @@ final class ArcanistFlake8Linter extends ArcanistExternalLinter { 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() { diff --git a/src/lint/linter/ArcanistPEP8Linter.php b/src/lint/linter/ArcanistPEP8Linter.php index 5b7c9edb..2f67a859 100644 --- a/src/lint/linter/ArcanistPEP8Linter.php +++ b/src/lint/linter/ArcanistPEP8Linter.php @@ -22,15 +22,10 @@ final class ArcanistPEP8Linter extends ArcanistExternalLinter { 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() { diff --git a/src/lint/linter/ArcanistPhpcsLinter.php b/src/lint/linter/ArcanistPhpcsLinter.php index acb53b4b..efbb3fca 100644 --- a/src/lint/linter/ArcanistPhpcsLinter.php +++ b/src/lint/linter/ArcanistPhpcsLinter.php @@ -49,12 +49,7 @@ final class ArcanistPhpcsLinter extends ArcanistExternalLinter { 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() { diff --git a/src/lint/linter/ArcanistPhutilLibraryLinter.php b/src/lint/linter/ArcanistPhutilLibraryLinter.php index d48c9dfc..f67b8fe4 100644 --- a/src/lint/linter/ArcanistPhutilLibraryLinter.php +++ b/src/lint/linter/ArcanistPhutilLibraryLinter.php @@ -28,10 +28,6 @@ final class ArcanistPhutilLibraryLinter extends ArcanistLinter { return 'PHL'; } - public function getLintSeverityMap() { - return array(); - } - public function willLintPaths(array $paths) { if (!xhpast_is_available()) { throw new Exception(xhpast_get_build_instructions()); diff --git a/src/lint/linter/ArcanistPyFlakesLinter.php b/src/lint/linter/ArcanistPyFlakesLinter.php index da6a10b2..25674364 100644 --- a/src/lint/linter/ArcanistPyFlakesLinter.php +++ b/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; } diff --git a/src/lint/linter/ArcanistPyLintLinter.php b/src/lint/linter/ArcanistPyLintLinter.php index 6bdca57f..c0fc82e3 100644 --- a/src/lint/linter/ArcanistPyLintLinter.php +++ b/src/lint/linter/ArcanistPyLintLinter.php @@ -187,22 +187,10 @@ final class ArcanistPyLintLinter extends ArcanistLinter { 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();