mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-11-21 22:32:41 +01:00
Apply various linter fixes.
Summary: Applied various linter fixes. Also make the `.editorconfig` file a bit more specific. Unfortunately, `arc lint --apply-patches` currently modifies some test data that it shouldn't, but this should be fixed after T5105. Test Plan: Ran `arc unit` to make sure things weren't broken. Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: epriestley, Korvin, aurelijus Differential Revision: https://secure.phabricator.com/D9440
This commit is contained in:
parent
b60eaa6487
commit
ff1915ecff
19 changed files with 43 additions and 43 deletions
|
@ -11,11 +11,11 @@ insert_final_newline = true
|
|||
trim_trailing_whitespace = false
|
||||
insert_final_newline = false
|
||||
|
||||
[src/parser/__tests__/diff/*]
|
||||
[src/parser/__tests__/diff/*.{git,hg,svn,u}diff]
|
||||
trim_trailing_whitespace = false
|
||||
insert_final_newline = false
|
||||
|
||||
[src/parser/__tests__/patches/*]
|
||||
[src/parser/__tests__/patches/*.gitpatch]
|
||||
trim_trailing_whitespace = false
|
||||
insert_final_newline = false
|
||||
|
||||
|
|
|
@ -68,8 +68,8 @@ final class ArcanistJSONLintLinter extends ArcanistExternalLinter {
|
|||
foreach ($lines as $line) {
|
||||
$matches = null;
|
||||
$match = preg_match(
|
||||
'/^(?:(?<path>.+): )?' .
|
||||
'line (?<line>\d+), col (?<column>\d+), ' .
|
||||
'/^(?:(?<path>.+): )?'.
|
||||
'line (?<line>\d+), col (?<column>\d+), '.
|
||||
'(?<description>.*)$/',
|
||||
$line,
|
||||
$matches);
|
||||
|
|
|
@ -131,8 +131,8 @@ final class ArcanistLesscLinter extends ArcanistExternalLinter {
|
|||
foreach ($lines as $line) {
|
||||
$matches = null;
|
||||
$match = preg_match(
|
||||
'/^(?P<name>\w+): (?P<description>.+) ' .
|
||||
'in (?P<path>.+|-) ' .
|
||||
'/^(?P<name>\w+): (?P<description>.+) '.
|
||||
'in (?P<path>.+|-) '.
|
||||
'on line (?P<line>\d+), column (?P<column>\d+):$/',
|
||||
$line,
|
||||
$matches);
|
||||
|
|
|
@ -252,7 +252,7 @@ final class ArcanistTextLinter extends ArcanistLinter {
|
|||
$this->raiseLintAtOffset(
|
||||
$offset,
|
||||
self::LINT_BOF_WHITESPACE,
|
||||
'This file contains leading whitespace at the beginning of the file. ' .
|
||||
'This file contains leading whitespace at the beginning of the file. '.
|
||||
'This is unnecessary and should be avoided when possible.',
|
||||
$string,
|
||||
'');
|
||||
|
@ -276,7 +276,7 @@ final class ArcanistTextLinter extends ArcanistLinter {
|
|||
$this->raiseLintAtOffset(
|
||||
$offset,
|
||||
self::LINT_EOF_WHITESPACE,
|
||||
'This file contains trailing whitespace at the end of the file. This ' .
|
||||
'This file contains trailing whitespace at the end of the file. This '.
|
||||
'is unnecessary and should be avoided when possible.',
|
||||
$string,
|
||||
'');
|
||||
|
|
|
@ -1081,8 +1081,8 @@ final class ArcanistXHPASTLinter extends ArcanistBaseXHPASTLinter {
|
|||
$this->raiseLintAtNode(
|
||||
$var,
|
||||
self::LINT_REUSED_ITERATOR_REFERENCE,
|
||||
'This variable was used already as a by-reference iterator ' .
|
||||
'variable. Such variables survive outside the foreach loop, ' .
|
||||
'This variable was used already as a by-reference iterator '.
|
||||
'variable. Such variables survive outside the foreach loop, '.
|
||||
'do not reuse.');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -62,7 +62,7 @@ final class ArcanistLintConsoleRenderer extends ArcanistLintRenderer {
|
|||
|
||||
if ($text) {
|
||||
$prefix = phutil_console_format("**>>>** Lint for __%s__:\n\n\n", $path);
|
||||
return $prefix . implode("\n", $text);
|
||||
return $prefix.implode("\n", $text);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -279,7 +279,7 @@ final class ArcanistDiffParser {
|
|||
"Expected a hunk header, like 'Index: /path/to/file.ext' (svn), ".
|
||||
"'Property changes on: /path/to/file.ext' (svn properties), ".
|
||||
"'commit 59bcc3ad6775562f845953cf01624225' (git show), ".
|
||||
"'diff --git' (git diff), '--- filename' (unified diff), or " .
|
||||
"'diff --git' (git diff), '--- filename' (unified diff), or ".
|
||||
"'diff -r' (hg diff or patch).");
|
||||
}
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
009C61O)~M2nh-c3=Iws5D^j+6crX17#SKH9337XAR!_nBqb&%C@Cr{EG;fCFflSSG&MFiI5|2yJUu=?KtV!7L`6nNNJ&adOifNtP*GA-R8>}2SXo+ITwPvYU}0ioWMyV&XlZI|Y;A6DaB*^Tbai%jczJqze0_d@fPsR8goTEOh>41ejE#<ukdcy;l$Dm3n3<ZJoSmMZprN9pq@|{(sHv)}tgWuEu(7hUw6(UkxVgH!yuH4^z`?@9#Kp$P$jQpf%+1cv(9zP<)YaD4*xB0K+}+;a;Njxq<mKk)=;`X~?CtLF@bU8V^!4`l`1$(#{Qds_|Ni~_`}+C#_xAPl^YZcV@9ypF>+0#~=jP?)<Kp4q-`?Ha+uGUK*Vfh4)6&t<&(6)v%gV{f$Hv9P!@|M9zrMY^ySll!x3;ykv$C<Uudc1EtE#D}r>3Q(qoSdppPrqZo0^%JmzI^3lai5;kB*Iui;9VehlYiOgMxv8e|~*@dwO|zcXoAjb8>NTZ*FaDYiem|XJ%z&V`5=oUtV2YTUuFIS5{S2Q&Le-PfkrtOG-&dM@B_NLqb77KR!J?J32WyH#RjiGcqwSFD@-CD=H}{CnhB%BO)OnA08bX8yXoH7Zw#16A}>+4-O3s3knGc2L=TM0|Eg6
|
||||
009C61O)~M2nh-c3=Iws5D^j+6crX17#SKH9337XAR!_nBqb&%C@Cr{EG;fCFflSSG&MFiI5|2yJUu=?KtV!7L`6nNNJ&adOifNtP*GA-R8>}2SXo+ITwPvYU}0ioWMyV&XlZI|Y;A6DaB*^Tbai%jczJqze0_d@fPsR8goTEOh>41ejE#<ukdcy;l$Dm3n3<ZJoSmMZprN9pq@|{(sHv)}tgWuEu(7hUw6(UkxVgH!yuH4^z`?@9#Kp$P$jQpf%+1cv(9zP<)YaD4*xB0K+}+;a;Njxq<mKk)=;`X~?CtLF@bU8V^!4`l`1$(#{Qds_|Ni~_`}+C#_xAPl^YZcV@9ypF>+0#~=jP?)<Kp4q-`?Ha+uGUK*Vfh4)6&t<&(6)v%gV{f$Hv9P!@|M9zrMY^ySll!x3;ykv$C<Uudc1EtE#D}r>3Q(qoSdppPrqZo0^%JmzI^3lai5;kB*Iui;9VehlYiOgMxv8e|~*@dwO|zcXoAjb8>NTZ*FaDYiem|XJ%z&V`5=oUtV2YTUuFIS5{S2Q&Le-PfkrtOG-&dM@B_NLqb77KR!J?J32WyH#RjiGcqwSFD@-CD=H}{CnhB%BO)OnA08bX8yXoH7Zw#16A}>+4-O3s3knGc2L=TM0|Eg6
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -128,7 +128,7 @@ final class ArcanistSubversionAPI extends ArcanistRepositoryAPI {
|
|||
|
||||
foreach ($files as $path => $mask) {
|
||||
foreach ($externals as $external) {
|
||||
if (!strncmp($path . '/', $external . '/', strlen($external) + 1)) {
|
||||
if (!strncmp($path.'/', $external.'/', strlen($external) + 1)) {
|
||||
$files[$path] |= self::FLAG_EXTERNALS;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ final class ArcanistRepositoryAPIStateTestCase extends ArcanistTestCase {
|
|||
}
|
||||
|
||||
private function parseState($test) {
|
||||
$dir = dirname(__FILE__) . '/state/';
|
||||
$dir = dirname(__FILE__).'/state/';
|
||||
$fixture = PhutilDirectoryFixture::newFromArchive($dir.'/'.$test);
|
||||
|
||||
$fixture_path = $fixture->getPath();
|
||||
|
|
|
@ -91,7 +91,7 @@ final class NoseTestEngine extends ArcanistBaseUnitTestEngine {
|
|||
$xunit_tmp);
|
||||
|
||||
if ($this->getEnableCoverage() !== false) {
|
||||
$cmd_line .= csprintf(' --with-coverage --cover-xml ' .
|
||||
$cmd_line .= csprintf(' --with-coverage --cover-xml '.
|
||||
'--cover-xml-file=%s',
|
||||
$cover_tmp);
|
||||
}
|
||||
|
|
|
@ -56,7 +56,7 @@ final class PhpunitResultParser extends ArcanistBaseTestResultParser {
|
|||
|
||||
if ('fail' == $event->status) {
|
||||
$status = ArcanistUnitTestResult::RESULT_FAIL;
|
||||
$user_data .= $event->message . "\n";
|
||||
$user_data .= $event->message."\n";
|
||||
foreach ($event->trace as $trace) {
|
||||
$user_data .= sprintf("\n%s:%s", $trace->file, $trace->line);
|
||||
}
|
||||
|
@ -150,7 +150,7 @@ final class PhpunitResultParser extends ArcanistBaseTestResultParser {
|
|||
$coverage .= 'N';
|
||||
}
|
||||
|
||||
$len = strlen($this->projectRoot . DIRECTORY_SEPARATOR);
|
||||
$len = strlen($this->projectRoot.DIRECTORY_SEPARATOR);
|
||||
$class_path = substr($class_path, $len);
|
||||
$reports[$class_path] = $coverage;
|
||||
}
|
||||
|
@ -169,16 +169,16 @@ final class PhpunitResultParser extends ArcanistBaseTestResultParser {
|
|||
private function getJsonReport($json) {
|
||||
|
||||
if (empty($json)) {
|
||||
throw new Exception('JSON report file is empty, '
|
||||
. 'it probably means that phpunit failed to run tests. '
|
||||
. 'Try running arc unit with --trace option and then run '
|
||||
. 'generated phpunit command yourself, you might get the '
|
||||
. 'answer.'
|
||||
throw new Exception('JSON report file is empty, '.
|
||||
'it probably means that phpunit failed to run tests. '.
|
||||
'Try running arc unit with --trace option and then run '.
|
||||
'generated phpunit command yourself, you might get the '.
|
||||
'answer.'
|
||||
);
|
||||
}
|
||||
|
||||
$json = preg_replace('/}{\s*"/', '},{"', $json);
|
||||
$json = '[' . $json . ']';
|
||||
$json = '['.$json.']';
|
||||
$json = json_decode($json);
|
||||
if (!is_array($json)) {
|
||||
throw new Exception('JSON could not be decoded');
|
||||
|
|
|
@ -261,16 +261,16 @@ final class PhpunitTestEngine extends ArcanistBaseUnitTestEngine {
|
|||
* based on phpunit_config option in .arcconfig
|
||||
*/
|
||||
private function prepareConfigFile() {
|
||||
$project_root = $this->projectRoot . DIRECTORY_SEPARATOR;
|
||||
$project_root = $this->projectRoot.DIRECTORY_SEPARATOR;
|
||||
$config = $this->getConfigurationManager()->getConfigFromAnySource(
|
||||
'phpunit_config');
|
||||
|
||||
if ($config) {
|
||||
if (Filesystem::pathExists($project_root . $config)) {
|
||||
$this->configFile = $project_root . $config;
|
||||
if (Filesystem::pathExists($project_root.$config)) {
|
||||
$this->configFile = $project_root.$config;
|
||||
} else {
|
||||
throw new Exception('PHPUnit configuration file was not ' .
|
||||
'found in ' . $project_root . $config);
|
||||
throw new Exception('PHPUnit configuration file was not '.
|
||||
'found in '.$project_root.$config);
|
||||
}
|
||||
}
|
||||
$bin = $this->getConfigurationManager()->getConfigFromAnySource(
|
||||
|
|
|
@ -791,7 +791,7 @@ abstract class ArcanistBaseWorkflow extends Phobject {
|
|||
if ($this->stashed) {
|
||||
$api = $this->getRepositoryAPI();
|
||||
$api->unstashChanges();
|
||||
echo pht('Restored stashed changes to the working directory.') . "\n";
|
||||
echo pht('Restored stashed changes to the working directory.')."\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -351,7 +351,7 @@ EOTEXT
|
|||
foreach ($out as &$feature) {
|
||||
unset($feature['color'], $feature['ssort'], $feature['esort']);
|
||||
}
|
||||
echo json_encode(ipull($out, null, 'name')) . "\n";
|
||||
echo json_encode(ipull($out, null, 'name'))."\n";
|
||||
} else {
|
||||
$console = PhutilConsole::getConsole();
|
||||
foreach ($out as $line) {
|
||||
|
|
|
@ -309,7 +309,7 @@ EOTEXT
|
|||
$this->branch,
|
||||
$this->onto);
|
||||
if (!$this->isHistoryImmutable()) {
|
||||
$message .= ' ' . pht("You may be able to 'arc amend' instead.");
|
||||
$message .= ' '.pht("You may be able to 'arc amend' instead.");
|
||||
}
|
||||
throw new ArcanistUsageException($message);
|
||||
}
|
||||
|
@ -571,7 +571,7 @@ EOTEXT
|
|||
} else if ($this->isHg) {
|
||||
echo phutil_console_format(pht(
|
||||
'Updating **%s**...',
|
||||
$this->onto) . "\n");
|
||||
$this->onto)."\n");
|
||||
|
||||
try {
|
||||
list($out, $err) = $repository_api->execxLocal('pull');
|
||||
|
@ -962,7 +962,7 @@ EOTEXT
|
|||
if ($this->getArgument('hold')) {
|
||||
echo phutil_console_format(pht(
|
||||
'Holding change in **%s**: it has NOT been pushed yet.',
|
||||
$this->onto). "\n");
|
||||
$this->onto)."\n");
|
||||
} else {
|
||||
echo pht('Pushing change...'), "\n\n";
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@ EOTEXT
|
|||
return array(
|
||||
'lintall' => array(
|
||||
'help' =>
|
||||
'Show all lint warnings, not just those on changed lines. When ' .
|
||||
'Show all lint warnings, not just those on changed lines. When '.
|
||||
'paths are specified, this is the default behavior.',
|
||||
'conflicts' => array(
|
||||
'only-changed' => true,
|
||||
|
@ -71,9 +71,9 @@ EOTEXT
|
|||
),
|
||||
'only-changed' => array(
|
||||
'help' =>
|
||||
'Show lint warnings just on changed lines. When no paths are ' .
|
||||
'specified, this is the default. This differs from only-new ' .
|
||||
'in cases where line modifications introduce lint on other ' .
|
||||
'Show lint warnings just on changed lines. When no paths are '.
|
||||
'specified, this is the default. This differs from only-new '.
|
||||
'in cases where line modifications introduce lint on other '.
|
||||
'unmodified lines.',
|
||||
'conflicts' => array(
|
||||
'lintall' => true,
|
||||
|
|
|
@ -984,12 +984,12 @@ EOTEXT
|
|||
$source_revision = $this->loadRevisionFromHash($hash);
|
||||
|
||||
if ($bundle_revision) {
|
||||
$bundle_base_rev_str = $bundle_base_rev .
|
||||
' \ D' . $bundle_revision['id'];
|
||||
$bundle_base_rev_str = $bundle_base_rev.
|
||||
' \ D'.$bundle_revision['id'];
|
||||
}
|
||||
if ($source_revision) {
|
||||
$source_base_rev_str = $source_base_rev .
|
||||
' \ D' . $source_revision['id'];
|
||||
$source_base_rev_str = $source_base_rev.
|
||||
' \ D'.$source_revision['id'];
|
||||
}
|
||||
}
|
||||
$bundle_base_rev_str = nonempty($bundle_base_rev_str,
|
||||
|
|
Loading…
Reference in a new issue