arc lint命令失败,错误#1

时间:2016-07-12 14:33:07

标签: php python pylint phabricator arcanist

我已通过在ArrayList<String> tabs2 = new ArrayList<String>(driver.getWindowHandles()); System.out.println(tabs2.size()); for (int i = tabs2.size()-1; i>=0; i--) { Thread.sleep(2000); driver.switchTo().window(tabs2.get(i)); Robot robot = new Robot(); robot.keyPress(KeyEvent.VK_CONTROL); robot.keyPress(KeyEvent.VK_TAB); robot.keyRelease(KeyEvent.VK_TAB); robot.keyRelease(KeyEvent.VK_CONTROL); System.out.println(driver.getTitle() + "i: " + i); driver.close(); } 文件中定义链接来配置arc lint以使用pylint

.arclint

在任何{ "linters": { "pylint": { "type": "pylint", "include": "(\\.py$)" } } } 上执行arc lint命令后,我会收到下一个异常:

*.py

我的[2016-07-12 14:18:10] EXCEPTION: (PhutilAggregateException) Some linters failed: - CommandException: Command failed with error #1! COMMAND 'pylint' '--reports=no' '--msg-template={line}|{column}|{msg_id}|{symbol}|{msg}' '/Users/aivaneyko/Projects/raw/module/file.py' STDOUT ************* Module module.file STDERR Traceback (most recent call last): File "/Users/aivaneyko/Projects/raw/env/bin/pylint", line 11, in <module> sys.exit(run_pylint()) File "/Users/aivaneyko/Projects/raw/env/lib/python2.7/site-packages/pylint/__init__.py", line 23, in run_pylint Run(sys.argv[1:]) File "/Users/aivaneyko/Projects/raw/env/lib/python2.7/site-packages/pylint/lint.py", line 1315, in __init__ linter.check(args) File "/Users/aivaneyko/Projects/raw/env/lib/python2.7/site-packages/pylint/lint.py", line 736, in check self._do_check(files_or_modules) File "/Users/aivaneyko/Projects/raw/env/lib/python2.7/site-packages/pylint/lint.py", line 867, in _do_check self.check_astroid_module(ast_node, walker, rawcheckers, tokencheckers) File "/Users/aivaneyko/Projects/raw/env/lib/python2.7/site-packages/pylint/lint.py", line 947, in check_astroid_module walker.walk(ast_node) File "/Users/aivaneyko/Projects/raw/env/lib/python2.7/site-packages/pylint/utils.py", line 938, in walk self.wa... (1,689 more bytes) ... at [<arcanist>/src/lint/engine/ArcanistLintEngine.php:274] arcanist(head=master, ref.master=4d4d16f25985), phutil(head=master, ref.master=32c56dc20b39) #0 <#2> ExecFuture::resolvex() called at [<arcanist>/src/lint/linter/ArcanistExternalLinter.php:448] #1 <#2> ArcanistExternalLinter::resolveFuture(string, ExecFuture) called at [<arcanist>/src/lint/linter/ArcanistFutureLinter.php:34] #2 <#2> ArcanistFutureLinter::didLintPaths(array) called at [<arcanist>/src/lint/engine/ArcanistLintEngine.php:594] #3 <#2> ArcanistLintEngine::executeDidLintOnPaths(ArcanistPyLintLinter, array) called at [<arcanist>/src/lint/engine/ArcanistLintEngine.php:545] #4 <#2> ArcanistLintEngine::executeLintersOnChunk(array, array) called at [<arcanist>/src/lint/engine/ArcanistLintEngine.php:473] #5 <#2> ArcanistLintEngine::executeLinters(array) called at [<arcanist>/src/lint/engine/ArcanistLintEngine.php:216] #6 ArcanistLintEngine::run() called at [<arcanist>/src/workflow/ArcanistLintWorkflow.php:334] #7 ArcanistLintWorkflow::run() called at [<arcanist>/scripts/arcanist.php:394] 输出:

  

arcanist 4d4d16f25985f133501f20fdddd183e525f00341(2016年6月28日)

     

libphutil 32c56dc20b39cffd0cfef931f6f4ab9c99f12677(2016年7月7日)

我的arc --version输出:

  

pylint 1.5.6,astroid 1.4.7 Python 2.7.10(默认,2015年10月23日,   19:19:21)[GCC 4.2.1兼容的Apple LLVM 7.0.0(clang-700.0.59.5)]

我在 PHP 5.5.34 上遇到异常,升级到 PHP 5.6.23 问题仍然存在。此外,我还尝试安装其他版本的奥术师而没有成功 - pylint --versionarcanist 57f6fb59d73994d90cd94143787424ce0fdbf73b (25 Jan 2016)

操作系统: El Capitan 10.11.5

1 个答案:

答案 0 :(得分:2)

就我而言,问题与ValueError: unknown locale: UTF-8

有关

如果你在MacOS上遇到同样的错误,那么快速修复(以bash导出):

export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8

如何解决:

请使用&#34; test.php&#34;用于重现问题的脚本(提供文件路径而不是&#34;路径到文件/文件&#34;):

<?php
$descriptorspec = array(
    0 => array("pipe", "r"),
    1 => array("pipe", "w"),
    2 => array("file", "error_output.txt", "a")
);
$process = proc_open('"pylint" "--reports=no" "--msg-template={line}|{column}|{msg_id}|{symbol}|{msg}"   "path-to-file/file"', $descriptorspec, $pipes);
if (is_resource($process)) {
    fclose($pipes[0]);
    echo stream_get_contents($pipes[1]);
    fclose($pipes[1]);
    $return_value = proc_close($process);
    echo "command returned $return_value\n";
}
?>

您可以检查错误&#34; error_output.txt&#34;文件(如果存在)。

祝你好运! :)