1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-12-01 19:22:41 +01:00

(stable) Promote 2016 Week 3

This commit is contained in:
epriestley 2016-01-15 09:10:00 -08:00
commit 2412c31346
2 changed files with 14 additions and 9 deletions

View file

@ -14,14 +14,15 @@ final class ArcanistCpplintLinter extends ArcanistExternalLinter {
} }
public function getDefaultBinary() { public function getDefaultBinary() {
return 'cpplint'; return 'cpplint.py';
} }
public function getInstallInstructions() { public function getInstallInstructions() {
return pht( return pht(
'Install cpplint.py using `%s`.', 'Install cpplint.py using `%s`, and place it in your path with the '.
'wget http://google-styleguide.googlecode.com'. 'appropriate permissions set.',
'/svn/trunk/cpplint/cpplint.py'); 'wget https://raw.github.com'.
'/google/styleguide/gh-pages/cpplint/cpplint.py');
} }
protected function getDefaultMessageSeverity($code) { protected function getDefaultMessageSeverity($code) {
@ -60,7 +61,7 @@ final class ArcanistCpplintLinter extends ArcanistExternalLinter {
} }
protected function getLintCodeFromLinterConfigurationKey($code) { protected function getLintCodeFromLinterConfigurationKey($code) {
if (!preg_match('@^[a-z_]+/[a-z_]+$@', $code)) { if (!preg_match('@^[a-z_]+/[a-z0-9_+]+$@', $code)) {
throw new Exception( throw new Exception(
pht( pht(
'Unrecognized lint message code "%s". Expected a valid cpplint '. 'Unrecognized lint message code "%s". Expected a valid cpplint '.

View file

@ -108,7 +108,8 @@
* not specified, defaults to the linted file. It is generally not necessary * not specified, defaults to the linted file. It is generally not necessary
* to capture this unless the linter can raise messages in files other than * to capture this unless the linter can raise messages in files other than
* the one it is linting. * the one it is linting.
* - `line` (optional) The line number of the message. * - `line` (optional) The line number of the message. If no text is
* captured, the message is assumed to affect the entire file.
* - `char` (optional) The character offset of the message. * - `char` (optional) The character offset of the message.
* - `offset` (optional) The byte offset of the message. If captured, this * - `offset` (optional) The byte offset of the message. If captured, this
* supersedes `line` and `char`. * supersedes `line` and `char`.
@ -324,7 +325,7 @@ final class ArcanistScriptAndRegexLinter extends ArcanistLinter {
* Get the line and character of the message from the regex match. * Get the line and character of the message from the regex match.
* *
* @param dict Captured groups from regex. * @param dict Captured groups from regex.
* @return pair<int,int|null> Line and character of the message. * @return pair<int|null,int|null> Line and character of the message.
* *
* @task parse * @task parse
*/ */
@ -337,11 +338,14 @@ final class ArcanistScriptAndRegexLinter extends ArcanistLinter {
} }
$line = idx($match, 'line'); $line = idx($match, 'line');
if ($line) { if (strlen($line)) {
$line = (int)$line; $line = (int)$line;
} else { if (!$line) {
$line = 1; $line = 1;
} }
} else {
$line = null;
}
$char = idx($match, 'char'); $char = idx($match, 'char');
if ($char) { if ($char) {