1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-09-19 16:38:51 +02:00

Fix the wrong argument type being passed to setFlags.

Summary:
Currently, the `ComprehensiveLintEngine` fails to lint `*.py` files with the following exception:

```
> arc lint foo.py
[2014-05-22 01:17:12] ERROR 2: escapeshellarg() expects parameter 1 to be string, array given at [/home/joshua/dotfiles/modules/phabricator/libphutil/src/xsprintf/csprintf.php:87]
  #0 escapeshellarg(Array { 0 => --ignore=E101,E501,W291,W292,W293 })
  #1 array_map(escapeshellarg, Array { 0 => Array { 0 => --ignore=E101,E501,W291,W292,W293 } }) called at [/home/joshua/dotfiles/modules/phabricator/libphutil/src/xsprintf/csprintf.php:87]
  #2 xsprintf_command(Array { unmasked => false }, %s %s, 4, Array { 0 => Array { 0 => --ignore=E101,E501,W291,W292,W293 } }, 5) called at [/home/joshua/dotfiles/modules/phabricator/libphutil/src/xsprintf/xsprintf.php:63]
  #3 xsprintf(xsprintf_command, Array { unmasked => false }, Array of size 3 starting with: { 0 => %C %Ls }) called at [/home/joshua/dotfiles/modules/phabricator/libphutil/src/xsprintf/PhutilCommandString.php:33]
  #4 PhutilCommandString::renderString(false) called at [/home/joshua/dotfiles/modules/phabricator/libphutil/src/xsprintf/PhutilCommandString.php:24]
  #5 PhutilCommandString::getMaskedString() called at [/home/joshua/dotfiles/modules/phabricator/libphutil/src/xsprintf/PhutilCommandString.php:12]
  #6 PhutilCommandString::__construct(Array of size 3 starting with: { 0 => %C %Ls }) called at [/home/joshua/dotfiles/modules/phabricator/libphutil/src/xsprintf/csprintf.php:34]
  #7 csprintf(%C %Ls, Object PhutilCommandString, Array { 0 => Array { 0 => --ignore=E101,E501,W291,W292,W293 } }) called at [/home/joshua/workspace/github.com/facebook/arcanist/src/lint/linter/ArcanistExternalLinter.php:400]
  #8 ArcanistExternalLinter::buildFutures(Array { 0 => foo.py }) called at [/home/joshua/workspace/github.com/facebook/arcanist/src/lint/linter/ArcanistFutureLinter.php:17]
  #9 ArcanistFutureLinter::willLintPaths(Array { 0 => foo.py }) called at [/home/joshua/workspace/github.com/facebook/arcanist/src/lint/engine/ArcanistLintEngine.php:297]
  #10 ArcanistLintEngine::run() called at [/home/joshua/workspace/github.com/facebook/arcanist/src/workflow/ArcanistLintWorkflow.php:336]
  #11 ArcanistLintWorkflow::run() called at [/home/joshua/workspace/github.com/facebook/arcanist/scripts/arcanist.php:322]
[2014-05-22 01:17:12] ERROR 2: escapeshellarg() expects parameter 1 to be string, array given at [/home/joshua/dotfiles/modules/phabricator/libphutil/src/xsprintf/csprintf.php:87]
  #0 escapeshellarg(Array { 0 => --ignore=E101,E501,W291,W292,W293 })
  #1 array_map(escapeshellarg, Array { 0 => Array { 0 => --ignore=E101,E501,W291,W292,W293 } }) called at [/home/joshua/dotfiles/modules/phabricator/libphutil/src/xsprintf/csprintf.php:87]
  #2 xsprintf_command(Array { unmasked => false }, %s %s, 4, Array { 0 => Array { 0 => --ignore=E101,E501,W291,W292,W293 } }, 5) called at [/home/joshua/dotfiles/modules/phabricator/libphutil/src/xsprintf/xsprintf.php:63]
  #3 xsprintf(xsprintf_command, Array { unmasked => false }, Array of size 3 starting with: { 0 => %C %Ls }) called at [/home/joshua/dotfiles/modules/phabricator/libphutil/src/xsprintf/PhutilCommandString.php:33]
  #4 PhutilCommandString::renderString(false) called at [/home/joshua/dotfiles/modules/phabricator/libphutil/src/xsprintf/PhutilCommandString.php:24]
  #5 PhutilCommandString::getMaskedString() called at [/home/joshua/dotfiles/modules/phabricator/libphutil/src/xsprintf/csprintf.php:65]
  #6 xsprintf_command(Array { unmasked => false }, %C %C, 1, Object PhutilCommandString, 5) called at [/home/joshua/dotfiles/modules/phabricator/libphutil/src/xsprintf/xsprintf.php:63]
  #7 xsprintf(xsprintf_command, Array { unmasked => false }, Array of size 3 starting with: { 0 => %C %C }) called at [/home/joshua/dotfiles/modules/phabricator/libphutil/src/xsprintf/PhutilCommandString.php:33]
  #8 PhutilCommandString::renderString(false) called at [/home/joshua/dotfiles/modules/phabricator/libphutil/src/xsprintf/PhutilCommandString.php:24]
  #9 PhutilCommandString::getMaskedString() called at [/home/joshua/dotfiles/modules/phabricator/libphutil/src/xsprintf/PhutilCommandString.php:12]
  #10 PhutilCommandString::__construct(Array of size 3 starting with: { 0 => %C %C }) called at [/home/joshua/dotfiles/modules/phabricator/libphutil/src/xsprintf/csprintf.php:34]
  #11 csprintf(%C %C, Object PhutilCommandString, Object PhutilCommandString)
  #12 call_user_func_array(csprintf, Array of size 3 starting with: { 0 => %C %C }) called at [/home/joshua/dotfiles/modules/phabricator/libphutil/src/future/exec/ExecFuture.php:72]
  #13 ExecFuture::__construct(%C %C, Object PhutilCommandString, Object PhutilCommandString) called at [/home/joshua/workspace/github.com/facebook/arcanist/src/lint/linter/ArcanistExternalLinter.php:414]
  #14 ArcanistExternalLinter::buildFutures(Array { 0 => foo.py }) called at [/home/joshua/workspace/github.com/facebook/arcanist/src/lint/linter/ArcanistFutureLinter.php:17]
  #15 ArcanistFutureLinter::willLintPaths(Array { 0 => foo.py }) called at [/home/joshua/workspace/github.com/facebook/arcanist/src/lint/engine/ArcanistLintEngine.php:297]
  #16 ArcanistLintEngine::run() called at [/home/joshua/workspace/github.com/facebook/arcanist/src/workflow/ArcanistLintWorkflow.php:336]
  #17 ArcanistLintWorkflow::run() called at [/home/joshua/workspace/github.com/facebook/arcanist/scripts/arcanist.php:322]
[2014-05-22 01:17:12] ERROR 2: escapeshellarg() expects parameter 1 to be string, array given at [/home/joshua/dotfiles/modules/phabricator/libphutil/src/xsprintf/csprintf.php:87]
  #0 escapeshellarg(Array { 0 => --ignore=E101,E501,W291,W292,W293 })
  #1 array_map(escapeshellarg, Array { 0 => Array { 0 => --ignore=E101,E501,W291,W292,W293 } }) called at [/home/joshua/dotfiles/modules/phabricator/libphutil/src/xsprintf/csprintf.php:87]
  #2 xsprintf_command(Array { unmasked => false }, %s %s, 4, Array { 0 => Array { 0 => --ignore=E101,E501,W291,W292,W293 } }, 5) called at [/home/joshua/dotfiles/modules/phabricator/libphutil/src/xsprintf/xsprintf.php:63]
  #3 xsprintf(xsprintf_command, Array { unmasked => false }, Array of size 3 starting with: { 0 => %C %Ls }) called at [/home/joshua/dotfiles/modules/phabricator/libphutil/src/xsprintf/PhutilCommandString.php:33]
  #4 PhutilCommandString::renderString(false) called at [/home/joshua/dotfiles/modules/phabricator/libphutil/src/xsprintf/PhutilCommandString.php:24]
  #5 PhutilCommandString::getMaskedString() called at [/home/joshua/dotfiles/modules/phabricator/libphutil/src/xsprintf/csprintf.php:65]
  #6 xsprintf_command(Array { unmasked => false }, %C %C, 1, Object PhutilCommandString, 5) called at [/home/joshua/dotfiles/modules/phabricator/libphutil/src/xsprintf/xsprintf.php:63]
  #7 xsprintf(xsprintf_command, Array { unmasked => false }, Array of size 3 starting with: { 0 => %C %C }) called at [/home/joshua/dotfiles/modules/phabricator/libphutil/src/xsprintf/PhutilCommandString.php:33]
  #8 PhutilCommandString::renderString(false) called at [/home/joshua/dotfiles/modules/phabricator/libphutil/src/xsprintf/PhutilCommandString.php:24]
  #9 PhutilCommandString::getMaskedString() called at [/home/joshua/dotfiles/modules/phabricator/libphutil/src/xsprintf/PhutilCommandString.php:16]
  #10 PhutilCommandString::__toString() called at [/home/joshua/dotfiles/modules/phabricator/libphutil/src/future/exec/ExecFuture.php:611]
  #11 ExecFuture::isReady() called at [/home/joshua/dotfiles/modules/phabricator/libphutil/src/future/FutureIterator.php:322]
  #12 FutureIterator::updateWorkingSet() called at [/home/joshua/dotfiles/modules/phabricator/libphutil/src/future/FutureIterator.php:97]
  #13 FutureIterator::addFuture(Object ExecFuture, foo.py) called at [/home/joshua/workspace/github.com/facebook/arcanist/src/lint/linter/ArcanistFutureLinter.php:18]
  #14 ArcanistFutureLinter::willLintPaths(Array { 0 => foo.py }) called at [/home/joshua/workspace/github.com/facebook/arcanist/src/lint/engine/ArcanistLintEngine.php:297]
  #15 ArcanistLintEngine::run() called at [/home/joshua/workspace/github.com/facebook/arcanist/src/workflow/ArcanistLintWorkflow.php:336]
  #16 ArcanistLintWorkflow::run() called at [/home/joshua/workspace/github.com/facebook/arcanist/scripts/arcanist.php:322]
[2014-05-22 01:17:12] ERROR 2: escapeshellarg() expects parameter 1 to be string, array given at [/home/joshua/dotfiles/modules/phabricator/libphutil/src/xsprintf/csprintf.php:87]
  #0 escapeshellarg(Array { 0 => --ignore=E101,E501,W291,W292,W293 })
  #1 array_map(escapeshellarg, Array { 0 => Array { 0 => --ignore=E101,E501,W291,W292,W293 } }) called at [/home/joshua/dotfiles/modules/phabricator/libphutil/src/xsprintf/csprintf.php:87]
  #2 xsprintf_command(Array { unmasked => true }, %s %s, 4, Array { 0 => Array { 0 => --ignore=E101,E501,W291,W292,W293 } }, 5) called at [/home/joshua/dotfiles/modules/phabricator/libphutil/src/xsprintf/xsprintf.php:63]
  #3 xsprintf(xsprintf_command, Array { unmasked => true }, Array of size 3 starting with: { 0 => %C %Ls }) called at [/home/joshua/dotfiles/modules/phabricator/libphutil/src/xsprintf/PhutilCommandString.php:33]
  #4 PhutilCommandString::renderString(true) called at [/home/joshua/dotfiles/modules/phabricator/libphutil/src/xsprintf/PhutilCommandString.php:20]
  #5 PhutilCommandString::getUnmaskedString() called at [/home/joshua/dotfiles/modules/phabricator/libphutil/src/xsprintf/csprintf.php:63]
  #6 xsprintf_command(Array { unmasked => true }, %C %C, 1, Object PhutilCommandString, 5) called at [/home/joshua/dotfiles/modules/phabricator/libphutil/src/xsprintf/xsprintf.php:63]
  #7 xsprintf(xsprintf_command, Array { unmasked => true }, Array of size 3 starting with: { 0 => %C %C }) called at [/home/joshua/dotfiles/modules/phabricator/libphutil/src/xsprintf/PhutilCommandString.php:33]
  #8 PhutilCommandString::renderString(true) called at [/home/joshua/dotfiles/modules/phabricator/libphutil/src/xsprintf/PhutilCommandString.php:20]
  #9 PhutilCommandString::getUnmaskedString() called at [/home/joshua/dotfiles/modules/phabricator/libphutil/src/future/exec/ExecFuture.php:622]
  #10 ExecFuture::isReady() called at [/home/joshua/dotfiles/modules/phabricator/libphutil/src/future/FutureIterator.php:322]
  #11 FutureIterator::updateWorkingSet() called at [/home/joshua/dotfiles/modules/phabricator/libphutil/src/future/FutureIterator.php:97]
  #12 FutureIterator::addFuture(Object ExecFuture, foo.py) called at [/home/joshua/workspace/github.com/facebook/arcanist/src/lint/linter/ArcanistFutureLinter.php:18]
  #13 ArcanistFutureLinter::willLintPaths(Array { 0 => foo.py }) called at [/home/joshua/workspace/github.com/facebook/arcanist/src/lint/engine/ArcanistLintEngine.php:297]
  #14 ArcanistLintEngine::run() called at [/home/joshua/workspace/github.com/facebook/arcanist/src/workflow/ArcanistLintWorkflow.php:336]
  #15 ArcanistLintWorkflow::run() called at [/home/joshua/workspace/github.com/facebook/arcanist/scripts/arcanist.php:322]
```

Test Plan: Ran `arc lint foo.py` on an empty file.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9251
This commit is contained in:
Joshua Spence 2014-05-21 18:23:21 -07:00 committed by epriestley
parent 07895c41c7
commit bca14a368b

View file

@ -33,7 +33,7 @@ final class ComprehensiveLintEngine extends ArcanistLintEngine {
$py_paths = preg_grep('/\.py$/', $paths);
$linters[] = id(new ArcanistPyFlakesLinter())->setPaths($py_paths);
$linters[] = id(new ArcanistPEP8Linter())
->setFlags(array($this->getPEP8WithTextOptions()))
->setFlags($this->getPEP8WithTextOptions())
->setPaths($py_paths);
$linters[] = id(new ArcanistRubyLinter())