diff --git a/src/lint/linter/ArcanistCSSLintLinter.php b/src/lint/linter/ArcanistCSSLintLinter.php --- a/src/lint/linter/ArcanistCSSLintLinter.php +++ b/src/lint/linter/ArcanistCSSLintLinter.php @@ -24,7 +24,7 @@ } public function getMandatoryFlags() { - return '--format=lint-xml'; + return array('--format=lint-xml'); } public function getDefaultFlags() { diff --git a/src/lint/linter/ArcanistExternalLinter.php b/src/lint/linter/ArcanistExternalLinter.php --- a/src/lint/linter/ArcanistExternalLinter.php +++ b/src/lint/linter/ArcanistExternalLinter.php @@ -15,7 +15,7 @@ private $flags; -/* -( Interpreters, Binaries and Flags )----------------------------------- */ +/* -( Interpreters, Binaries and ar )----------------------------------- */ /** @@ -117,11 +117,11 @@ * Flags which are not mandatory should be provided in * @{method:getDefaultFlags} instead. * - * @return string|null Mandatory flags, like `"--format=xml"`. + * @return list Mandatory flags, like `"--format=xml"`. * @task bin */ protected function getMandatoryFlags() { - return null; + return array(); } @@ -133,11 +133,11 @@ * * Default flags can be overridden with @{method:setFlags}. * - * @return string|null Overridable default flags. + * @return list Overridable default flags. * @task bin */ protected function getDefaultFlags() { - return null; + return array(); } @@ -145,7 +145,7 @@ * Override default flags with custom flags. If not overridden, flags provided * by @{method:getDefaultFlags} are used. * - * @param string New flags. + * @param list|string New flags. * @return this * @task bin */ @@ -352,10 +352,9 @@ * @task exec */ protected function getCommandFlags() { - return csprintf( - '%C %C', - $this->getMandatoryFlags(), - coalesce($this->flags, $this->getDefaultFlags())); + return implode(' ', array_merge( + (array) $this->getMandatoryFlags(), + (array) coalesce($this->flags, $this->getDefaultFlags()))); } @@ -410,7 +409,7 @@ public function getLinterConfigurationOptions() { $options = array( 'bin' => 'optional string | list', - 'flags' => 'optional string', + 'flags' => 'optional string | list', ); if ($this->shouldUseInterpreter()) { diff --git a/src/lint/linter/ArcanistFlake8Linter.php b/src/lint/linter/ArcanistFlake8Linter.php --- a/src/lint/linter/ArcanistFlake8Linter.php +++ b/src/lint/linter/ArcanistFlake8Linter.php @@ -21,7 +21,7 @@ $config = $this->getEngine()->getConfigurationManager(); - $options = $config->getConfigFromAnySource('lint.flake8.options', ''); + $options = $config->getConfigFromAnySource('lint.flake8.options', array()); return $options; } diff --git a/src/lint/linter/ArcanistPhpcsLinter.php b/src/lint/linter/ArcanistPhpcsLinter.php --- a/src/lint/linter/ArcanistPhpcsLinter.php +++ b/src/lint/linter/ArcanistPhpcsLinter.php @@ -26,7 +26,7 @@ } public function getMandatoryFlags() { - return '--report=xml'; + return array('--report=xml'); } public function getInstallInstructions() { @@ -41,7 +41,13 @@ $options = $config->getConfigFromAnySource('lint.phpcs.options'); $standard = $config->getConfigFromAnySource('lint.phpcs.standard'); - $options .= !empty($standard) ? ' --standard=' . $standard : ''; + if (!empty($standard)) { + if (is_array($options)) { + $options[] = '--standard=' . $standard; + } else { + $options .= ' --standard=' . $standard; + } + } return $options; } diff --git a/src/lint/linter/ArcanistRubyLinter.php b/src/lint/linter/ArcanistRubyLinter.php --- a/src/lint/linter/ArcanistRubyLinter.php +++ b/src/lint/linter/ArcanistRubyLinter.php @@ -41,7 +41,7 @@ protected function getMandatoryFlags() { // -w: turn on warnings // -c: check syntax - return '-w -c'; + return array('-w', '-c'); } protected function getDefaultMessageSeverity($code) {