mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-11-22 06:42:41 +01:00
Catch more product names in "pht()", and replace newly matched Arcanist product names
Summary: Ref T13658. The lint rule called "getStringLiteralValue()", which produces string literals for fewer nodes than "evalStatic()". Switch to "evalStatic()", then fix new warnings. Test Plan: This test plan is non-exhaustive. - Ran "arc lint --everything --output summary" to generate new warnings. Maniphest Tasks: T13658 Differential Revision: https://secure.phabricator.com/D21776
This commit is contained in:
parent
93cf13cdb9
commit
da206314cf
10 changed files with 42 additions and 43 deletions
|
@ -125,8 +125,8 @@ class PhutilLibraryTestCase extends PhutilTestCase {
|
||||||
$failures[] = pht(
|
$failures[] = pht(
|
||||||
'Class "%s" implements method "%s" with the wrong visibility. '.
|
'Class "%s" implements method "%s" with the wrong visibility. '.
|
||||||
'The method has visibility "%s", but it is defined in parent '.
|
'The method has visibility "%s", but it is defined in parent '.
|
||||||
'"%s" with visibility "%s". In Phabricator, a method which '.
|
'"%s" with visibility "%s". A method which overrides another '.
|
||||||
'overrides another must always have the same visibility.',
|
'must always have the same visibility.',
|
||||||
$class_name,
|
$class_name,
|
||||||
$method_name,
|
$method_name,
|
||||||
$this->getVisibility($method),
|
$this->getVisibility($method),
|
||||||
|
|
|
@ -7,11 +7,11 @@ final class ArcanistSettings extends Phobject {
|
||||||
'default' => array(
|
'default' => array(
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'help' => pht(
|
'help' => pht(
|
||||||
'The URI of a Phabricator install to connect to by default, if '.
|
'The URI of a server to connect to by default, if '.
|
||||||
'%s is run in a project without a Phabricator URI or run outside '.
|
'%s is run in a project without a configured URI or run outside '.
|
||||||
'of a project.',
|
'of a project.',
|
||||||
'arc'),
|
'arc'),
|
||||||
'example' => '"http://phabricator.example.com/"',
|
'example' => '"http://devtools.example.com/"',
|
||||||
),
|
),
|
||||||
'base' => array(
|
'base' => array(
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
|
@ -35,7 +35,7 @@ final class ArcanistSettings extends Phobject {
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'example' => '"X"',
|
'example' => '"X"',
|
||||||
'help' => pht(
|
'help' => pht(
|
||||||
'Associate the working copy with a specific Phabricator repository. '.
|
'Associate the working copy with a specific repository. '.
|
||||||
'Normally, %s can figure this association out on its own, but if '.
|
'Normally, %s can figure this association out on its own, but if '.
|
||||||
'your setup is unusual you can use this option to tell it what the '.
|
'your setup is unusual you can use this option to tell it what the '.
|
||||||
'desired value is.',
|
'desired value is.',
|
||||||
|
@ -44,10 +44,9 @@ final class ArcanistSettings extends Phobject {
|
||||||
'phabricator.uri' => array(
|
'phabricator.uri' => array(
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'legacy' => 'conduit_uri',
|
'legacy' => 'conduit_uri',
|
||||||
'example' => '"https://phabricator.mycompany.com/"',
|
'example' => '"https://devtools.example.com/"',
|
||||||
'help' => pht(
|
'help' => pht(
|
||||||
'Associates this working copy with a specific installation of '.
|
'Associates this working copy with a specific server.'),
|
||||||
'Phabricator.'),
|
|
||||||
),
|
),
|
||||||
'lint.engine' => array(
|
'lint.engine' => array(
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
|
@ -96,8 +95,8 @@ final class ArcanistSettings extends Phobject {
|
||||||
'https.cabundle' => array(
|
'https.cabundle' => array(
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'help' => pht(
|
'help' => pht(
|
||||||
"Path to a custom CA bundle file to be used for arcanist's cURL ".
|
"Path to a custom CA bundle file to be used for cURL calls. ".
|
||||||
"calls. This is used primarily when your conduit endpoint is ".
|
"This is used primarily when your conduit endpoint is ".
|
||||||
"behind HTTPS signed by your organization's internal CA."),
|
"behind HTTPS signed by your organization's internal CA."),
|
||||||
'example' => 'support/yourca.pem',
|
'example' => 'support/yourca.pem',
|
||||||
),
|
),
|
||||||
|
@ -118,7 +117,7 @@ final class ArcanistSettings extends Phobject {
|
||||||
'Whether %s should permit the automatic stashing of changes in the '.
|
'Whether %s should permit the automatic stashing of changes in the '.
|
||||||
'working directory when requiring a clean working copy. This option '.
|
'working directory when requiring a clean working copy. This option '.
|
||||||
'should only be used when users understand how to restore their '.
|
'should only be used when users understand how to restore their '.
|
||||||
'working directory from the local stash if an Arcanist operation '.
|
'working directory from the local stash if an operation '.
|
||||||
'causes an unrecoverable error.',
|
'causes an unrecoverable error.',
|
||||||
'arc'),
|
'arc'),
|
||||||
'default' => false,
|
'default' => false,
|
||||||
|
|
|
@ -139,10 +139,10 @@ final class ArcanistDifferentialCommitMessage extends Phobject {
|
||||||
throw new ArcanistUsageException(
|
throw new ArcanistUsageException(
|
||||||
pht(
|
pht(
|
||||||
'Invalid "Differential Revision" field in commit message. This field '.
|
'Invalid "Differential Revision" field in commit message. This field '.
|
||||||
'should have a revision identifier like "%s" or a Phabricator URI '.
|
'should have a revision identifier like "%s" or a server URI '.
|
||||||
'like "%s", but has "%s".',
|
'like "%s", but has "%s".',
|
||||||
'D123',
|
'D123',
|
||||||
'https://phabricator.example.com/D123',
|
'https://devtools.example.com/D123',
|
||||||
$revision_value));
|
$revision_value));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -64,11 +64,11 @@ final class ArcanistCSharpLinter extends ArcanistLinter {
|
||||||
throw new Exception(
|
throw new Exception(
|
||||||
pht(
|
pht(
|
||||||
"In order to keep StyleCop integration with IDEs and other tools ".
|
"In order to keep StyleCop integration with IDEs and other tools ".
|
||||||
"consistent with Arcanist results, you aren't permitted to ".
|
"consistent with lint results, you aren't permitted to ".
|
||||||
"disable StyleCop rules within '%s'. Instead configure the ".
|
"disable StyleCop rules within '%s'. Instead configure the ".
|
||||||
"severity using the StyleCop settings dialog (usually accessible ".
|
"severity using the StyleCop settings dialog (usually accessible ".
|
||||||
"from within your IDE). StyleCop settings for your project will ".
|
"from within your IDE). StyleCop settings for your project will ".
|
||||||
"be used when linting for Arcanist.",
|
"be used when linting.",
|
||||||
'.arclint'));
|
'.arclint'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -132,8 +132,8 @@ final class ArcanistCSharpLinter extends ArcanistLinter {
|
||||||
} else if ($ver > self::SUPPORTED_VERSION) {
|
} else if ($ver > self::SUPPORTED_VERSION) {
|
||||||
throw new Exception(
|
throw new Exception(
|
||||||
pht(
|
pht(
|
||||||
'Arcanist does not support this version of %s (it is newer). '.
|
'This version of %s is not supported (it is too new). '.
|
||||||
'You can try upgrading Arcanist with `%s`.',
|
'You can try upgrading with `%s`.',
|
||||||
'cslint',
|
'cslint',
|
||||||
'arc upgrade'));
|
'arc upgrade'));
|
||||||
}
|
}
|
||||||
|
|
|
@ -304,9 +304,9 @@ final class ArcanistPhutilLibraryLinter extends ArcanistLinter {
|
||||||
$details = pht(
|
$details = pht(
|
||||||
"Common causes are:\n".
|
"Common causes are:\n".
|
||||||
"\n".
|
"\n".
|
||||||
" - Your copy of Arcanist is out of date.\n".
|
" - Your copy of %s is out of date.\n".
|
||||||
" This is the most common cause.\n".
|
" This is the most common cause.\n".
|
||||||
" Update this copy of Arcanist:\n".
|
" Update this copy of %s:\n".
|
||||||
"\n".
|
"\n".
|
||||||
" %s\n".
|
" %s\n".
|
||||||
"\n".
|
"\n".
|
||||||
|
@ -324,6 +324,8 @@ final class ArcanistPhutilLibraryLinter extends ArcanistLinter {
|
||||||
" - This symbol is defined in an external library.\n".
|
" - This symbol is defined in an external library.\n".
|
||||||
" Use \"@phutil-external-symbol\" to annotate it.\n".
|
" Use \"@phutil-external-symbol\" to annotate it.\n".
|
||||||
" Use \"grep\" to find examples of usage.",
|
" Use \"grep\" to find examples of usage.",
|
||||||
|
PlatformSymbols::getPlatformClientName(),
|
||||||
|
PlatformSymbols::getPlatformClientName(),
|
||||||
$arcanist_root);
|
$arcanist_root);
|
||||||
|
|
||||||
$message = implode(
|
$message = implode(
|
||||||
|
|
|
@ -41,7 +41,7 @@ final class ArcanistProductNameLiteralXHPASTLinterRule
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$literal_value = $identifier->getStringLiteralValue();
|
$literal_value = $identifier->evalStatic();
|
||||||
|
|
||||||
$matches = phutil_preg_match_all($search_pattern, $literal_value);
|
$matches = phutil_preg_match_all($search_pattern, $literal_value);
|
||||||
if (!$matches[0]) {
|
if (!$matches[0]) {
|
||||||
|
|
|
@ -270,9 +270,9 @@ final class ArcanistRuntime {
|
||||||
$problems[] = sprintf(
|
$problems[] = sprintf(
|
||||||
'The build of PHP you are running was compiled with the configure '.
|
'The build of PHP you are running was compiled with the configure '.
|
||||||
'flag "%s", which means it does not support the function "%s()". '.
|
'flag "%s", which means it does not support the function "%s()". '.
|
||||||
'This function is required for Arcanist to run. Install a standard '.
|
'This function is required for this software to run. Install a '.
|
||||||
'build of PHP or rebuild it without this flag. You may also be '.
|
'standard build of PHP or rebuild it without this flag. You may '.
|
||||||
'able to build or install the relevant extension separately.',
|
'also be able to build or install the relevant extension separately.',
|
||||||
$which,
|
$which,
|
||||||
$fname);
|
$fname);
|
||||||
continue;
|
continue;
|
||||||
|
@ -477,8 +477,8 @@ final class ArcanistRuntime {
|
||||||
$log->writeWarn(
|
$log->writeWarn(
|
||||||
pht('VERY META'),
|
pht('VERY META'),
|
||||||
pht(
|
pht(
|
||||||
'You are running one copy of Arcanist (at path "%s") against '.
|
'You are running one copy of this software (at path "%s") against '.
|
||||||
'another copy of Arcanist (at path "%s"). Code in the current '.
|
'another copy of this software (at path "%s"). Code in the current '.
|
||||||
'working directory will not be loaded or executed.',
|
'working directory will not be loaded or executed.',
|
||||||
$executing_directory,
|
$executing_directory,
|
||||||
$working_directory));
|
$working_directory));
|
||||||
|
@ -519,10 +519,10 @@ final class ArcanistRuntime {
|
||||||
if (!isset($toolsets[$binary])) {
|
if (!isset($toolsets[$binary])) {
|
||||||
throw new PhutilArgumentUsageException(
|
throw new PhutilArgumentUsageException(
|
||||||
pht(
|
pht(
|
||||||
'Arcanist toolset "%s" is unknown. The Arcanist binary should '.
|
'Toolset "%s" is unknown. The binary should be executed so that '.
|
||||||
'be executed so that "argv[0]" identifies a supported toolset. '.
|
'"argv[0]" identifies a supported toolset. Rename the binary or '.
|
||||||
'Rename the binary or install the library that provides the '.
|
'install the library that provides the desired toolset. Current '.
|
||||||
'desired toolset. Current available toolsets: %s.',
|
'available toolsets: %s.',
|
||||||
$binary,
|
$binary,
|
||||||
implode(', ', array_keys($toolsets))));
|
implode(', ', array_keys($toolsets))));
|
||||||
}
|
}
|
||||||
|
|
|
@ -170,16 +170,14 @@ final class PhutilUnitTestEngine extends ArcanistUnitTestEngine {
|
||||||
if (!$library_name) {
|
if (!$library_name) {
|
||||||
throw new Exception(
|
throw new Exception(
|
||||||
pht(
|
pht(
|
||||||
"Attempting to run unit tests on a libphutil library which has ".
|
"Attempting to run unit tests on a library which has ".
|
||||||
"not been loaded, at:\n\n".
|
"not been loaded, at:\n\n".
|
||||||
" %s\n\n".
|
" %s\n\n".
|
||||||
"This probably means one of two things:\n\n".
|
"Make sure this library is configured to load.\n\n".
|
||||||
" - You may need to add this library to %s.\n".
|
"(In rare cases, this may be because you are attempting to run ".
|
||||||
" - You may be running tests on a copy of libphutil or ".
|
"one copy of this software against a different copy of this ".
|
||||||
"arcanist using a different copy of libphutil or arcanist. ".
|
"software. This operation is not supported.)",
|
||||||
"This operation is not supported.\n",
|
$library_root));
|
||||||
$library_root,
|
|
||||||
'.arcconfig.'));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$path = Filesystem::resolvePath($path, $root);
|
$path = Filesystem::resolvePath($path, $root);
|
||||||
|
|
|
@ -890,8 +890,8 @@ EOTEXT
|
||||||
'revision_id' => $revision_id,
|
'revision_id' => $revision_id,
|
||||||
));
|
));
|
||||||
$prompt_message = pht(
|
$prompt_message = pht(
|
||||||
' Note arcanist failed to load the commit message '.
|
' NOTE: Failed to load the commit message from Differential (for '.
|
||||||
'from differential for revision %s.',
|
'revision "%s".)',
|
||||||
"D{$revision_id}");
|
"D{$revision_id}");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -51,9 +51,9 @@ EOTEXT
|
||||||
if (!$is_git) {
|
if (!$is_git) {
|
||||||
throw new PhutilArgumentUsageException(
|
throw new PhutilArgumentUsageException(
|
||||||
pht(
|
pht(
|
||||||
'The "arc upgrade" workflow uses "git pull" to upgrade, but '.
|
'The "upgrade" workflow uses "git pull" to upgrade, but '.
|
||||||
'the "arcanist/" directory (in "%s") is not a Git working '.
|
'the software directory (in "%s") is not a Git working '.
|
||||||
'copy. You must leave "arcanist/" as a Git working copy to '.
|
'copy. You must leave this directory as a Git working copy to '.
|
||||||
'use "arc upgrade".',
|
'use "arc upgrade".',
|
||||||
$root));
|
$root));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue