From 78ce24a7099f64d04d9d8ea444b23834b4f50da3 Mon Sep 17 00:00:00 2001 From: Kai Liu Date: Fri, 14 Feb 2014 22:22:06 -0800 Subject: [PATCH] Fix the lint issues in dev box Summary: Owing to the difference between platforms (my macbook and dev server), arc lint throws fatal error in dev box. To fix the problem (quickly), I removed all incompatible function calls. Test Plan: ran `arc lint` in dev box and passed. Reviewers: igor, yhchiang CC: leveldb Differential Revision: https://reviews.facebook.net/D16173 --- linters/cpp_linter/ArcanistCpplintLinter.php | 31 ++------------------ 1 file changed, 3 insertions(+), 28 deletions(-) diff --git a/linters/cpp_linter/ArcanistCpplintLinter.php b/linters/cpp_linter/ArcanistCpplintLinter.php index cb7842248..b9c413755 100644 --- a/linters/cpp_linter/ArcanistCpplintLinter.php +++ b/linters/cpp_linter/ArcanistCpplintLinter.php @@ -19,32 +19,8 @@ final class ArcanistCpplintLinter extends ArcanistLinter { return 'cpplint.py'; } - public function getLintOptions() { - $config = $this->getEngine()->getConfigurationManager(); - $options = $config->getConfigFromAnySource('lint.cpplint.options', ''); - - return $options; - } - public function getLintPath() { - $config = $this->getEngine()->getConfigurationManager(); - $prefix = $config->getConfigFromAnySource('lint.cpplint.prefix'); - $bin = $config->getConfigFromAnySource('lint.cpplint.bin', 'cpplint.py'); - - if ($prefix !== null) { - if (!Filesystem::pathExists($prefix.'/'.$bin)) { - throw new ArcanistUsageException( - "Unable to find cpplint.py binary in a specified directory. Make ". - "sure that 'lint.cpplint.prefix' and 'lint.cpplint.bin' keys are ". - "set correctly. If you'd rather use a copy of cpplint installed ". - "globally, you can just remove these keys from your .arcconfig."); - } - - $bin = csprintf("%s/%s", $prefix, $bin); - - return $bin; - } - + $bin = 'cpplint.py'; // Search under current dir list($err) = exec_manual('which %s/%s', $this->linterDir(), $bin); if (!$err) { @@ -57,7 +33,7 @@ final class ArcanistCpplintLinter extends ArcanistLinter { throw new ArcanistUsageException( "cpplint.py does not appear to be installed on this system. Install ". "it (e.g., with 'wget \"http://google-styleguide.googlecode.com/". - "svn/trunk/cpplint/cpplint.py\"') or configure 'lint.cpplint.prefix' ". + "svn/trunk/cpplint/cpplint.py\"') ". "in your .arcconfig to point to the directory where it resides. ". "Also don't forget to chmod a+x cpplint.py!"); } @@ -67,10 +43,9 @@ final class ArcanistCpplintLinter extends ArcanistLinter { public function lintPath($path) { $bin = $this->getLintPath(); - $options = $this->getLintOptions(); $path = $this->rocksdbDir().'/'.$path; - $f = new ExecFuture("%C %C $path", $bin, $options); + $f = new ExecFuture("%C $path", $bin); list($err, $stdout, $stderr) = $f->resolve();