]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Use Remarkup in linter messages
authorJoshua Spence <josh@freelancer.com>
Mon, 23 Nov 2015 19:43:09 +0000 (06:43 +1100)
committerJoshua Spence <josh@freelancer.com>
Mon, 23 Nov 2015 19:43:09 +0000 (06:43 +1100)
Summary: Use Remarkup (specifically, backticks) within linter messages. Depends on D14485.

Test Plan: Eyeball it.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D14489

35 files changed:
src/lint/linter/xhpast/rules/ArcanistArrayCombineXHPASTLinterRule.php
src/lint/linter/xhpast/rules/ArcanistClassExtendsObjectXHPASTLinterRule.php
src/lint/linter/xhpast/rules/ArcanistClassFilenameMismatchXHPASTLinterRule.php
src/lint/linter/xhpast/rules/ArcanistClassNameLiteralXHPASTLinterRule.php
src/lint/linter/xhpast/rules/ArcanistCommentStyleXHPASTLinterRule.php
src/lint/linter/xhpast/rules/ArcanistDeclarationParenthesesXHPASTLinterRule.php
src/lint/linter/xhpast/rules/ArcanistDynamicDefineXHPASTLinterRule.php
src/lint/linter/xhpast/rules/ArcanistElseIfUsageXHPASTLinterRule.php
src/lint/linter/xhpast/rules/ArcanistExitExpressionXHPASTLinterRule.php
src/lint/linter/xhpast/rules/ArcanistExtractUseXHPASTLinterRule.php
src/lint/linter/xhpast/rules/ArcanistFormattedStringXHPASTLinterRule.php
src/lint/linter/xhpast/rules/ArcanistImplicitConstructorXHPASTLinterRule.php
src/lint/linter/xhpast/rules/ArcanistImplicitFallthroughXHPASTLinterRule.php
src/lint/linter/xhpast/rules/ArcanistInstanceOfOperatorXHPASTLinterRule.php
src/lint/linter/xhpast/rules/ArcanistInvalidDefaultParameterXHPASTLinterRule.php
src/lint/linter/xhpast/rules/ArcanistInvalidModifiersXHPASTLinterRule.php
src/lint/linter/xhpast/rules/ArcanistKeywordCasingXHPASTLinterRule.php
src/lint/linter/xhpast/rules/ArcanistLambdaFuncFunctionXHPASTLinterRule.php
src/lint/linter/xhpast/rules/ArcanistNamingConventionsXHPASTLinterRule.php
src/lint/linter/xhpast/rules/ArcanistNewlineAfterOpenTagXHPASTLinterRule.php
src/lint/linter/xhpast/rules/ArcanistNoParentScopeXHPASTLinterRule.php
src/lint/linter/xhpast/rules/ArcanistPHPCloseTagXHPASTLinterRule.php
src/lint/linter/xhpast/rules/ArcanistPHPEchoTagXHPASTLinterRule.php
src/lint/linter/xhpast/rules/ArcanistPHPOpenTagXHPASTLinterRule.php
src/lint/linter/xhpast/rules/ArcanistPHPShortTagXHPASTLinterRule.php
src/lint/linter/xhpast/rules/ArcanistParseStrUseXHPASTLinterRule.php
src/lint/linter/xhpast/rules/ArcanistPlusOperatorOnStringsXHPASTLinterRule.php
src/lint/linter/xhpast/rules/ArcanistPregQuoteMisuseXHPASTLinterRule.php
src/lint/linter/xhpast/rules/ArcanistRaggedClassTreeEdgeXHPASTLinterRule.php
src/lint/linter/xhpast/rules/ArcanistReusedIteratorReferenceXHPASTLinterRule.php
src/lint/linter/xhpast/rules/ArcanistSlownessXHPASTLinterRule.php
src/lint/linter/xhpast/rules/ArcanistStaticThisXHPASTLinterRule.php
src/lint/linter/xhpast/rules/ArcanistToStringExceptionXHPASTLinterRule.php
src/lint/linter/xhpast/rules/ArcanistUnnecessaryFinalModifierXHPASTLinterRule.php
src/lint/linter/xhpast/rules/ArcanistUnsafeDynamicStringXHPASTLinterRule.php

index 659bd30b82a35fb475d9dade70bd500a720ae46e..8d500c29c5f65b075effffda558f04f2d4edb4e8 100644 (file)
@@ -6,7 +6,7 @@ final class ArcanistArrayCombineXHPASTLinterRule
   const ID = 84;
 
   public function getLintName() {
-    return pht('%s Unreliable', 'array_combine()');
+    return pht('`%s` Unreliable', 'array_combine()');
   }
 
   public function getLintSeverity() {
@@ -35,8 +35,8 @@ final class ArcanistArrayCombineXHPASTLinterRule
             'Prior to PHP 5.4, `%s` fails when given empty arrays. '.
             'Prefer to write `%s` as `%s`.',
             'array_combine()',
-            'array_combine(x, x)',
-            'array_fuse(x)'));
+            'array_combine($x, $x)',
+            'array_fuse($x)'));
       }
     }
   }
index d712b3fe23f0194c15553498b567abf776590ebf..c24dbc6cf992be9bfbee7589ac4274e9ba0f04ac 100644 (file)
@@ -6,7 +6,7 @@ final class ArcanistClassExtendsObjectXHPASTLinterRule
   const ID = 88;
 
   public function getLintName() {
-    return pht('Class Not Extending %s', 'Phobject');
+    return pht('Class Not Extending `%s`', 'Phobject');
   }
 
   public function getLintSeverity() {
@@ -29,8 +29,8 @@ final class ArcanistClassExtendsObjectXHPASTLinterRule
         $this->raiseLintAtNode(
           $class,
           pht(
-            'Classes should extend from %s or from some other class. '.
-            'All classes (except for %s itself) should have a base class.',
+            'Classes should extend from `%s` or from some other class. '.
+            'All classes (except for `%s` itself) should have a base class.',
             'Phobject',
             'Phobject'));
       }
index 5b91f3ca9a509a25d61987796e37c87e2e2a37b2..6c8c2f41b65f155a5742c8f7c07939d55a4cbda7 100644 (file)
@@ -47,7 +47,7 @@ final class ArcanistClassFilenameMismatchXHPASTLinterRule
       $decl_name,
       pht(
         "The name of this file differs from the name of the ".
-        "class or interface it declares. Rename the file to '%s'.",
+        'class or interface it declares. Rename the file to `%s`.',
         $rename));
   }
 
index cfa0bf935b6fde580ada23c49b0b5e8cb4549482..a22a985920e20d1cf5cb4c31fe2269c0ea519bc0 100644 (file)
@@ -39,7 +39,7 @@ final class ArcanistClassNameLiteralXHPASTLinterRule
         $this->raiseLintAtNode(
           $string,
           pht(
-            "Don't hard-code class names, use %s instead.",
+            "Don't hard-code class names, use `%s` instead.",
             '__CLASS__'),
           $replacement);
       }
index a5fe569cc2efddcdec0ffda0f5f5020fc3bb5fca..3a493e2b187409a8c6ad6220dd2a453ff07f99cc 100644 (file)
@@ -19,7 +19,10 @@ final class ArcanistCommentStyleXHPASTLinterRule
 
       $this->raiseLintAtOffset(
         $comment->getOffset(),
-        pht('Use "%s" single-line comments, not "%s".', '//', '#'),
+        pht(
+          'Use `%s` single-line comments, not `%s`.',
+          '//',
+          '#'),
         '#',
         preg_match('/^#\S/', $value) ? '// ' : '//');
     }
index 6606b0b30469fd7244f46ad0931b3053bb58a53f..1f5de9311d1905a3ddebf3398111dc01b719210d 100644 (file)
@@ -78,7 +78,9 @@ final class ArcanistDeclarationParenthesesXHPASTLinterRule
         if (!$before) {
           $this->raiseLintAtOffset(
             $use->getOffset(),
-            pht('Convention: space before `%s` token.', 'use'),
+            pht(
+              'Convention: space before `%s` token.',
+              'use'),
             '',
             ' ');
         }
@@ -86,7 +88,9 @@ final class ArcanistDeclarationParenthesesXHPASTLinterRule
         if (!$after) {
           $this->raiseLintAtOffset(
             $use->getOffset() + strlen($use->getValue()),
-            pht('Convention: space after `%s` token.', 'use'),
+            pht(
+              'Convention: space after `%s` token.',
+              'use'),
             '',
             ' ');
         }
index 4148df3bd871febe2269792a175e03b577dad57b..be144625b03e2d40dbe9458f594b009141a2f5aa 100644 (file)
@@ -6,7 +6,7 @@ final class ArcanistDynamicDefineXHPASTLinterRule
   const ID = 12;
 
   public function getLintName() {
-    return pht('Dynamic %s', 'define()');
+    return pht('Dynamic `%s`', 'define');
   }
 
   public function process(XHPASTNode $root) {
@@ -20,8 +20,8 @@ final class ArcanistDynamicDefineXHPASTLinterRule
         $this->raiseLintAtNode(
           $defined,
           pht(
-            'First argument to %s must be a string literal.',
-            'define()'));
+            'First argument to `%s` must be a string literal.',
+            'define'));
       }
     }
   }
index 986859f8c7d79edae8d212c750f88efb197176cc..246e8048966f9bf5dc6dfbb254ee03686fbdb5f4 100644 (file)
@@ -6,7 +6,7 @@ final class ArcanistElseIfUsageXHPASTLinterRule
   const ID = 42;
 
   public function getLintName() {
-    return pht('ElseIf Usage');
+    return pht('`elseif` Usage');
   }
 
   public function getLintSeverity() {
@@ -19,7 +19,10 @@ final class ArcanistElseIfUsageXHPASTLinterRule
     foreach ($tokens as $token) {
       $this->raiseLintAtToken(
         $token,
-        pht('Usage of `%s` is preferred over `%s`.', 'else if', 'elseif'),
+        pht(
+          'Usage of `%s` is preferred over `%s`.',
+          'else if',
+          'elseif'),
         'else if');
     }
   }
index 60ce126cab7de8832b4a3626ee3b1a24c83baf29..ceac22c38c13ebcc6779ec1776f0aa0dadb3fc43 100644 (file)
@@ -21,7 +21,7 @@ final class ArcanistExitExpressionXHPASTLinterRule
   const ID = 17;
 
   public function getLintName() {
-    return pht('Exit Used as Expression');
+    return pht('`%s` Used as Expression', 'exit');
   }
 
   public function process(XHPASTNode $root) {
@@ -34,7 +34,9 @@ final class ArcanistExitExpressionXHPASTLinterRule
         if ($unary->getParentNode()->getTypeName() !== 'n_STATEMENT') {
           $this->raiseLintAtNode(
             $unary,
-            pht('Use `%s` as a statement, not an expression.', 'exit'));
+            pht(
+              'Use `%s` as a statement, not an expression.',
+              'exit'));
         }
       }
     }
index 88a655ccfffb349a4145d46547e7d227752838d8..1c6976de31b6500a4297c8e9ff37f3c25143ca46 100644 (file)
@@ -6,7 +6,7 @@ final class ArcanistExtractUseXHPASTLinterRule
   const ID = 4;
 
   public function getLintName() {
-    return pht('Use of %s', 'extract()');
+    return pht('Use of `%s`', 'extract');
   }
 
   public function process(XHPASTNode $root) {
@@ -16,8 +16,8 @@ final class ArcanistExtractUseXHPASTLinterRule
       $this->raiseLintAtNode(
         $call,
         pht(
-          'Avoid %s. It is confusing and hinders static analysis.',
-          'extract()'));
+          'Avoid `%s`. It is confusing and hinders static analysis.',
+          'extract'));
     }
   }
 
index 2f25dccc3cd9c962724218ee3c37a4c0fa59ea04..333d7ab16050e9cc721171eaa0122b5453116846 100644 (file)
@@ -16,7 +16,7 @@ final class ArcanistFormattedStringXHPASTLinterRule
       'xhpast.printf-functions' => array(
         'type' => 'optional map<string, int>',
         'help' => pht(
-          '%s-style functions which take a format string and list of values '.
+          '`%s`-style functions which take a format string and list of values '.
           'as arguments. The value for the mapping is the start index of the '.
           'function parameters (the index of the format string parameter).',
           'printf()'),
index 466f74feb8ef8a9bff145b37d0b452b518dd7ca5..cf3d567a29a62bca014782d0c8b1c8e021c051dd 100644 (file)
@@ -24,9 +24,10 @@ final class ArcanistImplicitConstructorXHPASTLinterRule
           $this->raiseLintAtNode(
             $method_name_token,
             pht(
-              'Name constructors %s explicitly. This method is a constructor '.
-              ' because it has the same name as the class it is defined in.',
-              '__construct()'));
+              'Name constructors `%s` explicitly. This method is a '.
+              'constructor because it has the same name as the class '.
+              'it is defined in.',
+              '__construct'));
         }
       }
     }
index 74c7d57b2629a62fe4ec86ddeeea513476cf832a..1fe7a2a7c57881ca7a97ac67789688f2893031a1 100644 (file)
@@ -20,10 +20,10 @@ final class ArcanistImplicitFallthroughXHPASTLinterRule
       'xhpast.switchhook' => array(
         'type' => 'optional string',
         'help' => pht(
-          'Name of a concrete subclass of %s which tunes the '.
-          'analysis of %s statements for this linter.',
+          'Name of a concrete subclass of `%s` which tunes the '.
+          'analysis of `%s` statements for this linter.',
           'ArcanistXHPASTLintSwitchHook',
-          'switch()'),
+          'switch'),
       ),
     );
   }
@@ -190,9 +190,9 @@ final class ArcanistImplicitFallthroughXHPASTLinterRule
           $this->raiseLintAtToken(
             head($tokens),
             pht(
-              "This '%s' or '%s' has a nonempty block which does not end ".
-              "with '%s', '%s', '%s', '%s' or '%s'. Did you forget to add ".
-              "one of those? If you intend to fall through, add a '%s' ".
+              'This `%s` or `%s` has a nonempty block which does not end '.
+              'with `%s`, `%s`, `%s`, `%s` or `%s`. Did you forget to add '.
+              'one of those? If you intend to fall through, add a `%s` '.
               "comment to silence this warning.",
               'case',
               'default',
index 519d56457ff5d963ac4914f7930769c6c85c9869..47cb9ab551031c75a76de6b5664a46afdc97f432 100644 (file)
@@ -6,7 +6,7 @@ final class ArcanistInstanceOfOperatorXHPASTLinterRule
   const ID = 69;
 
   public function getLintName() {
-    return pht('%s Operator', 'instanceof');
+    return pht('`%s` Operator', 'instanceof');
   }
 
   public function process(XHPASTNode $root) {
@@ -26,7 +26,7 @@ final class ArcanistInstanceOfOperatorXHPASTLinterRule
         $this->raiseLintAtNode(
           $object,
           pht(
-            '%s expects an object instance, constant given.',
+            '`%s` expects an object instance, constant given.',
             'instanceof'));
       }
     }
index 12bdcf1754c6c8ea257c148601a65c4904794b0d..482fb396ed15de4292eb37572a0fe5acea032e6e 100644 (file)
@@ -39,8 +39,8 @@ final class ArcanistInvalidDefaultParameterXHPASTLinterRule
           $this->raiseLintAtNode(
             $default,
             pht(
-              'Default value for parameters with %s type hint '.
-              'can only be an %s or %s.',
+              'Default value for parameters with `%s` type hint '.
+              'can only be an `%s` or `%s`.',
               'array',
               'array',
               'null'));
@@ -54,7 +54,8 @@ final class ArcanistInvalidDefaultParameterXHPASTLinterRule
           $this->raiseLintAtNode(
             $default,
             pht(
-              'Default value for parameters with %s type hint can only be %s.',
+              'Default value for parameters with `%s` type hint '.
+              'can only be `%s`.',
               'callable',
               'null'));
           break;
@@ -69,7 +70,7 @@ final class ArcanistInvalidDefaultParameterXHPASTLinterRule
             $default,
             pht(
               'Default value for parameters with a class type hint '.
-              'can only be %s.',
+              'can only be `%s`.',
               'null'));
           break;
       }
index e8c87a3a7ad5620f5f1fb204fa27eb804a29f7ee..c1e6cc6f79e5cdf0a75654e525c9cf0858dabfe1 100644 (file)
@@ -30,7 +30,7 @@ final class ArcanistInvalidModifiersXHPASTLinterRule
               $this->raiseLintAtNode(
                 $modifier,
                 pht(
-                  'Properties cannot be declared %s.',
+                  'Properties cannot be declared `%s`.',
                   'abstract'));
             }
 
@@ -38,7 +38,7 @@ final class ArcanistInvalidModifiersXHPASTLinterRule
               $this->raiseLintAtNode(
                 $modifier,
                 pht(
-                  'Multiple %s modifiers are not allowed.',
+                  'Multiple `%s` modifiers are not allowed.',
                   'abstract'));
             }
 
@@ -46,7 +46,7 @@ final class ArcanistInvalidModifiersXHPASTLinterRule
               $this->raiseLintAtNode(
                 $modifier,
                 pht(
-                'Cannot use the %s modifier on an %s class member',
+                'Cannot use the `%s` modifier on an `%s` class member',
                 'final',
                 'abstract'));
             }
@@ -59,7 +59,7 @@ final class ArcanistInvalidModifiersXHPASTLinterRule
               $this->raiseLintAtNode(
                 $modifier,
                 pht(
-                'Cannot use the %s modifier on an %s class member',
+                'Cannot use the `%s` modifier on an `%s` class member',
                 'final',
                 'abstract'));
             }
@@ -68,7 +68,7 @@ final class ArcanistInvalidModifiersXHPASTLinterRule
               $this->raiseLintAtNode(
                 $modifier,
                 pht(
-                  'Multiple %s modifiers are not allowed.',
+                  'Multiple `%s` modifiers are not allowed.',
                   'final'));
             }
 
@@ -91,7 +91,7 @@ final class ArcanistInvalidModifiersXHPASTLinterRule
               $this->raiseLintAtNode(
                 $modifier,
                 pht(
-                  'Multiple %s modifiers are not allowed.',
+                  'Multiple `%s` modifiers are not allowed.',
                   'static'));
             }
             break;
index bc7c6bb6dcdcea0072731ae01638ce7b0dab8108..af0b590346b4a28a36a3523d2253ada985b8db3f 100644 (file)
@@ -89,7 +89,7 @@ final class ArcanistKeywordCasingXHPASTLinterRule
         $this->raiseLintAtToken(
           $keyword,
           pht(
-            "Convention: spell keyword '%s' as '%s'.",
+            'Convention: spell keyword `%s` as `%s`.',
             $value,
             strtolower($value)),
           strtolower($value));
@@ -115,7 +115,7 @@ final class ArcanistKeywordCasingXHPASTLinterRule
           $this->raiseLintAtNode(
             $symbol,
             pht(
-              "Convention: spell keyword '%s' as '%s'.",
+              'Convention: spell keyword `%s` as `%s`.',
               $symbol_name,
               strtolower($symbol_name)),
             strtolower($symbol_name));
index 34be9bafbd75fde95cda0ad89a236f8f861e4af9..2ddeb72248fa41b809c84fdb5bdbe8a825f42a3d 100644 (file)
@@ -6,7 +6,7 @@ final class ArcanistLambdaFuncFunctionXHPASTLinterRule
   const ID = 68;
 
   public function getLintName() {
-    return pht('%s Function', '__lambda_func');
+    return pht('`%s` Function', '__lambda_func');
   }
 
   public function process(XHPASTNode $root) {
@@ -28,10 +28,10 @@ final class ArcanistLambdaFuncFunctionXHPASTLinterRule
       $this->raiseLintAtNode(
         $function_declaration,
         pht(
-          'Declaring a function named %s causes any call to %s to fail. '.
-          'This is because %s eval-declares the function %s, then '.
+          'Declaring a function named `%s` causes any call to %s to fail. '.
+          'This is because `%s` eval-declares the function `%s`, then '.
           'modifies the symbol table so that the function is instead '.
-          'named %s, and returns that name.',
+          'named `%s`, and returns that name.',
           '__lambda_func',
           'create_function',
           'create_function',
index 24852abf895416a54cd2fe06bd870451a55db3b6..3d00ed089433f623cd4d342da52bd9f3c3b0bf10 100644 (file)
@@ -20,7 +20,7 @@ final class ArcanistNamingConventionsXHPASTLinterRule
       'xhpast.naminghook' => array(
         'type' => 'optional string',
         'help' => pht(
-          'Name of a concrete subclass of %s which enforces more '.
+          'Name of a concrete subclass of `%s` which enforces more '.
           'granular naming convention rules for symbols.',
           'ArcanistXHPASTLintNamingHook'),
       ),
@@ -56,8 +56,8 @@ final class ArcanistNamingConventionsXHPASTLinterRule
         ArcanistXHPASTLintNamingHook::isUpperCamelCase($name_string)
           ? null
           : pht(
-            'Follow naming conventions: classes should be named using '.
-            'UpperCamelCase.'),
+            'Follow naming conventions: classes should be named using `%s`.',
+            'UpperCamelCase'),
       );
     }
 
@@ -72,8 +72,8 @@ final class ArcanistNamingConventionsXHPASTLinterRule
         ArcanistXHPASTLintNamingHook::isUpperCamelCase($name_string)
           ? null
           : pht(
-            'Follow naming conventions: interfaces should be named using '.
-            'UpperCamelCase.'),
+            'Follow naming conventions: interfaces should be named using `%s`.',
+            'UpperCamelCase'),
       );
     }
 
@@ -94,8 +94,8 @@ final class ArcanistNamingConventionsXHPASTLinterRule
           ArcanistXHPASTLintNamingHook::stripPHPFunction($name_string))
           ? null
           : pht(
-            'Follow naming conventions: functions should be named using '.
-            'lowercase_with_underscores.'),
+            'Follow naming conventions: functions should be named using `%s`.',
+            'lowercase_with_underscores'),
       );
     }
 
@@ -112,8 +112,8 @@ final class ArcanistNamingConventionsXHPASTLinterRule
           ArcanistXHPASTLintNamingHook::stripPHPFunction($name_string))
           ? null
           : pht(
-            'Follow naming conventions: methods should be named using '.
-            'lowerCamelCase.'),
+            'Follow naming conventions: methods should be named using `%s`.',
+            'lowerCamelCase'),
       );
     }
 
@@ -137,8 +137,9 @@ final class ArcanistNamingConventionsXHPASTLinterRule
             ArcanistXHPASTLintNamingHook::stripPHPVariable($name_string))
             ? null
             : pht(
-              'Follow naming conventions: parameters should be named using '.
-              'lowercase_with_underscores.'),
+              'Follow naming conventions: parameters '.
+              'should be named using `%s`',
+              'lowercase_with_underscores'),
         );
       }
     }
@@ -157,8 +158,9 @@ final class ArcanistNamingConventionsXHPASTLinterRule
           ArcanistXHPASTLintNamingHook::isUppercaseWithUnderscores($name_string)
             ? null
             : pht(
-              'Follow naming conventions: class constants should be named '.
-              'using UPPERCASE_WITH_UNDERSCORES.'),
+              'Follow naming conventions: class constants '.
+              'should be named using `%s`',
+              'UPPERCASE_WITH_UNDERSCORES'),
         );
       }
     }
@@ -184,8 +186,9 @@ final class ArcanistNamingConventionsXHPASTLinterRule
             ArcanistXHPASTLintNamingHook::stripPHPVariable($name_string))
             ? null
             : pht(
-              'Follow naming conventions: class properties should be named '.
-              'using lowerCamelCase.'),
+              'Follow naming conventions: class properties '.
+              'should be named using `%s`.',
+              'lowerCamelCase'),
         );
       }
     }
@@ -269,8 +272,9 @@ final class ArcanistNamingConventionsXHPASTLinterRule
             ArcanistXHPASTLintNamingHook::stripPHPVariable($var_string))
               ? null
               : pht(
-                'Follow naming conventions: variables should be named using '.
-                'lowercase_with_underscores.'),
+                'Follow naming conventions: variables '.
+                'should be named using `%s`.',
+                'lowercase_with_underscores'),
         );
       }
     }
index 63bed6281c050c08d1c5625b8e0d8961cc8ab31b..4baa40537714a755c8cfb4f65d369229b4e81d2f 100644 (file)
@@ -38,7 +38,9 @@ final class ArcanistNewlineAfterOpenTagXHPASTLinterRule
       $next = $token->getNextToken();
       $this->raiseLintAtToken(
         $next,
-        pht('`%s` should be separated from code by an empty line.', '<?php'),
+        pht(
+          '`%s` should be separated from code by an empty line.',
+          '<?php'),
         "\n".$next->getValue());
     }
   }
index 1574a013ffede8cf1abac120f9fd07007a519d16..3aa1c4f9e63a18b093cd49834f36cb906ef4a4f7 100644 (file)
@@ -34,7 +34,7 @@ final class ArcanistNoParentScopeXHPASTLinterRule
             $this->raiseLintAtNode(
               $static_access,
               pht(
-                'Cannot access %s when current class scope has no parent.',
+                'Cannot access `%s` when current class scope has no parent.',
                 'parent::'));
           }
         }
index 1b943b54c908b300770f36a0979e28762665d9ba..95a9918fc6e3983d9f6e2a9c553bfcfedb766144 100644 (file)
@@ -6,7 +6,7 @@ final class ArcanistPHPCloseTagXHPASTLinterRule
   const ID = 8;
 
   public function getLintName() {
-    return pht('Use of Close Tag "%s"', '?>');
+    return pht('Use of Close Tag `%s`', '?>');
   }
 
   public function process(XHPASTNode $root) {
@@ -19,7 +19,9 @@ final class ArcanistPHPCloseTagXHPASTLinterRule
     foreach ($root->selectTokensOfType('T_CLOSE_TAG') as $token) {
       $this->raiseLintAtToken(
         $token,
-        pht('Do not use the PHP closing tag, "%s".', '?>'));
+        pht(
+          'Do not use the PHP closing tag, `%s`.',
+          '?>'));
     }
   }
 
index 5c863fbb7bdde44d25e76d189dda470e5d02ab00..6862d571b9afe4dacaf61fd7b88dd605dba51641 100644 (file)
@@ -6,7 +6,7 @@ final class ArcanistPHPEchoTagXHPASTLinterRule
   const ID = 7;
 
   public function getLintName() {
-    return pht('Use of Echo Tag "%s"', '<?=');
+    return pht('Use of Echo Tag `%s`', '<?=');
   }
 
   public function process(XHPASTNode $root) {
@@ -16,7 +16,9 @@ final class ArcanistPHPEchoTagXHPASTLinterRule
       if ($token->getTypeName() === 'T_OPEN_TAG_WITH_ECHO') {
         $this->raiseLintAtToken(
           $token,
-          pht('Avoid the PHP echo short form, "%s".', '<?='));
+          pht(
+            'Avoid the PHP echo short form, `%s`.',
+            '<?='));
       }
     }
   }
index efd288f386c18d1a9ea57dd5886201d8347b4baa..55e063595df213e365afd2aa2bf19eeb6bc8d421 100644 (file)
@@ -22,8 +22,8 @@ final class ArcanistPHPOpenTagXHPASTLinterRule
           $this->raiseLintAtToken(
             $token,
             pht(
-              'PHP files should start with "%s", which may be preceded by '.
-              'a "%s" line for scripts.',
+              'PHP files should start with `%s`, which may be preceded by '.
+              'a `%s` line for scripts.',
               '<?php',
               '#!'));
         }
index 2fd2f09543793238e825463485580945eff66361..72aa8abf2ca0f915cf8cfe43c83795dc2e560695 100644 (file)
@@ -6,7 +6,7 @@ final class ArcanistPHPShortTagXHPASTLinterRule
   const ID = 6;
 
   public function getLintName() {
-    return pht('Use of Short Tag "%s"', '<?');
+    return pht('Use of Short Tag `%s`', '<?');
   }
 
   public function process(XHPASTNode $root) {
@@ -18,7 +18,7 @@ final class ArcanistPHPShortTagXHPASTLinterRule
           $this->raiseLintAtToken(
             $token,
             pht(
-              'Use the full form of the PHP open tag, "%s".',
+              'Use the full form of the PHP open tag, `%s`.',
               '<?php'),
             "<?php\n");
         }
index 9656e4a7d2d5220d495a3d6bb6e5b7d70f1d7e04..edd2184ed27d246c062342f7cbb6fe34a8158871 100644 (file)
@@ -6,7 +6,7 @@ final class ArcanistParseStrUseXHPASTLinterRule
   const ID = 80;
 
   public function getLintName() {
-    return pht('Questionable Use of %s', 'parse_str()');
+    return pht('Questionable Use of `%s`', 'parse_str');
   }
 
   public function process(XHPASTNode $root) {
@@ -19,9 +19,9 @@ final class ArcanistParseStrUseXHPASTLinterRule
         $this->raiseLintAtNode(
           $call,
           pht(
-            'Avoid %s unless the second parameter is specified. '.
+            'Avoid `%s` unless the second parameter is specified. '.
             'It is confusing and hinders static analysis.',
-            'parse_str()'));
+            'parse_str'));
       }
     }
   }
index 15ee830067c1f15de145653fbf8f79d62cdae478..1f8d9ba0135cd3c9f211072df45146235d43f819 100644 (file)
@@ -26,9 +26,10 @@ final class ArcanistPlusOperatorOnStringsXHPASTLinterRule
         $this->raiseLintAtNode(
           $binop,
           pht(
-            "In PHP, '%s' is the string concatenation operator, not '%s'. ".
-            "This expression uses '+' with a string literal as an operand.",
+            'In PHP, `%s` is the string concatenation operator, not `%s`. '.
+            'This expression uses `%s` with a string literal as an operand.',
             '.',
+            '+',
             '+'));
       }
     }
index 37b3422d76c1561c0c03ebb00ae50654adf3fe4d..de5b522fd135ad33c794dce904fcb3affff3863a 100644 (file)
@@ -12,7 +12,7 @@ final class ArcanistPregQuoteMisuseXHPASTLinterRule
   const ID = 14;
 
   public function getLintName() {
-    return pht('Misuse of %s', 'preg_quote()');
+    return pht('Misuse of `%s`', 'preg_quote');
   }
 
   public function getLintSeverity() {
@@ -33,8 +33,8 @@ final class ArcanistPregQuoteMisuseXHPASTLinterRule
             'arguments to %s, so that %s knows which delimiter to escape.',
             '//',
             '()',
-            'preg_quote()',
-            'preg_quote()'));
+            'preg_quote',
+            'preg_quote'));
       }
     }
   }
index 64bfd87fc516ef9d2f124cb4b70df5d200197a2c..864d1f6e6cc9b598d4b0d1de906bbb10f82a4c89 100644 (file)
@@ -6,7 +6,7 @@ final class ArcanistRaggedClassTreeEdgeXHPASTLinterRule
   const ID = 87;
 
   public function getLintName() {
-    return pht('Class Not %s Or %s', 'abstract', 'final');
+    return pht('Class Not `%s` Or `%s`', 'abstract', 'final');
   }
 
   public function getLintSeverity() {
@@ -42,8 +42,8 @@ final class ArcanistRaggedClassTreeEdgeXHPASTLinterRule
         $this->raiseLintAtNode(
           $class->getChildOfType(1, 'n_CLASS_NAME'),
           pht(
-            "This class is neither '%s' nor '%s', and does not have ".
-            "a docblock marking it '%s'.",
+            'This class is neither `%s` nor `%s`, and does not have '.
+            'a docblock marking it `%s`.',
             'final',
             'abstract',
             '@concrete-extensible'));
index f33733325916d8e260d0af1f79b73b19a903b7bc..6585143502e7e7302b3e095d6ea330031cd41a6f 100644 (file)
@@ -173,7 +173,7 @@ final class ArcanistReusedIteratorReferenceXHPASTLinterRule
             $var,
             pht(
               'This variable was used already as a by-reference iterator '.
-              'variable. Such variables survive outside the %s loop, '.
+              'variable. Such variables survive outside the `%s` loop, '.
               'do not reuse.',
               'foreach'));
         }
index 79d33e0a7d61cce78b65432c70412a5d0d2cbb12..268ca5d09ee06f0c763225dc3cd8e4f697a42141 100644 (file)
@@ -51,14 +51,14 @@ final class ArcanistSlownessXHPASTLinterRule
         $this->raiseLintAtNode(
           $strstr,
           pht(
-            'Use %s for checking if the string contains something.',
-            'strpos()'));
+            'Use `%s` for checking if the string contains something.',
+            'strpos'));
       } else if ($name === 'stristr') {
         $this->raiseLintAtNode(
           $strstr,
           pht(
-            'Use %s for checking if the string contains something.',
-            'stripos()'));
+            'Use `%s` for checking if the string contains something.',
+            'stripos'));
       }
     }
   }
@@ -96,14 +96,14 @@ final class ArcanistSlownessXHPASTLinterRule
         $this->raiseLintAtNode(
           $strpos,
           pht(
-            'Use %s for checking if the string starts with something.',
-            'strncmp()'));
+            'Use `%s` for checking if the string starts with something.',
+            'strncmp'));
       } else if ($name === 'stripos') {
         $this->raiseLintAtNode(
           $strpos,
           pht(
-            'Use %s for checking if the string starts with something.',
-            'strncasecmp()'));
+            'Use `%s` for checking if the string starts with something.',
+            'strncasecmp'));
       }
     }
   }
index 1750a6dfe5543545f1c51ea0994129f95ad576ba..695d085857848aafe4aca3155065dacdcd0cfa18 100644 (file)
@@ -6,7 +6,7 @@ final class ArcanistStaticThisXHPASTLinterRule
   const ID = 13;
 
   public function getLintName() {
-    return pht('Use of %s in Static Context', '$this');
+    return pht('Use of `%s` in Static Context', '$this');
   }
 
   public function process(XHPASTNode $root) {
index c6a92314d79bac6f4b1bc20a9860f76df3c3457d..ab0eba56bfd954f582ff6602fdea355e843923f7 100644 (file)
@@ -6,7 +6,7 @@ final class ArcanistToStringExceptionXHPASTLinterRule
   const ID = 67;
 
   public function getLintName() {
-    return pht('Throwing Exception in %s Method', '__toString');
+    return pht('Throwing Exception in `%s` Method', '__toString');
   }
 
   public function process(XHPASTNode $root) {
@@ -33,7 +33,7 @@ final class ArcanistToStringExceptionXHPASTLinterRule
         $this->raiseLintAtNode(
           $throw,
           pht(
-            'It is not possible to throw an %s from within the %s method.',
+            'It is not possible to throw an `%s` from within the `%s` method.',
             'Exception',
             '__toString'));
       }
index 67021b474ffadd5be3bd6d359fef9cf90189e3e6..1abbaa013302b4dbd33b125da2eab5a56f69c4c9 100644 (file)
@@ -40,7 +40,7 @@ final class ArcanistUnnecessaryFinalModifierXHPASTLinterRule
             $this->raiseLintAtNode(
               $attribute,
               pht(
-                'Unnecessary %s modifier in %s class.',
+                'Unnecessary `%s` modifier in `%s` class.',
                 'final',
                 'final'));
           }
index be483f3c9b3ffe396ef0c78a8f87af6397260618..2cd343bf8cdf9ae53ed70f09b341e46300802054 100644 (file)
@@ -92,10 +92,10 @@ final class ArcanistUnsafeDynamicStringXHPASTLinterRule
         $this->raiseLintAtNode(
           $call,
           pht(
-            "Parameter %d of %s should be a scalar string, ".
+            "Parameter %d of `%s` should be a scalar string, ".
             "otherwise it's not safe.",
             $param + 1,
-            $name.'()'));
+            $name));
       }
     }
   }