Page MenuHomePhabricator

Add a table showing all XHPAST linter rules to the output of `arc linters xhpast`
ClosedPublic

Authored by joshuaspence on Nov 23 2015, 9:33 PM.
Tags
None
Referenced Files
F13815200: D14563.id35318.diff
Thu, Sep 19, 8:58 AM
Unknown Object (File)
Sun, Aug 25, 4:53 AM
Unknown Object (File)
Sat, Aug 24, 5:59 AM
Unknown Object (File)
Fri, Aug 23, 5:04 PM
Unknown Object (File)
Aug 19 2024, 5:47 AM
Unknown Object (File)
Aug 17 2024, 11:58 AM
Unknown Object (File)
Aug 17 2024, 2:05 AM
Unknown Object (File)
Aug 16 2024, 8:51 PM
Subscribers

Details

Summary

Now that we have 91 subclasses of ArcanistXHPASTLinterRule, it is becoming difficult to manage the IDs. This diff adds a table to arc linters xhpast workflow to facilitate this.

Test Plan
> arc xhpast-linter-rules

+=====+=======================================================+===================================================================+
| ID  | Class                                                 | Name                                                              |
+=====+=======================================================+===================================================================+
| 1   | ArcanistSyntaxErrorXHPASTLinterRule                   | PHP Syntax Error!                                                 |
| 2   | ArcanistUnableToParseXHPASTLinterRule                 | Unable to Parse                                                   |
| 3   | ArcanistVariableVariableXHPASTLinterRule              | Use of Variable Variable                                          |
| 4   | ArcanistExtractUseXHPASTLinterRule                    | Use of `extract`                                                  |
| 5   | ArcanistUndeclaredVariableXHPASTLinterRule            | Use of Undeclared Variable                                        |
| 6   | ArcanistPHPShortTagXHPASTLinterRule                   | Use of Short Tag `<?`                                             |
| 7   | ArcanistPHPEchoTagXHPASTLinterRule                    | Use of Echo Tag `<?=`                                             |
| 8   | ArcanistPHPCloseTagXHPASTLinterRule                   | Use of Close Tag `?>`                                             |
| 9   | ArcanistNamingConventionsXHPASTLinterRule             | Naming Conventions                                                |
| 10  | ArcanistImplicitConstructorXHPASTLinterRule           | Implicit Constructor                                              |
| 12  | ArcanistDynamicDefineXHPASTLinterRule                 | Dynamic `define`                                                  |
| 13  | ArcanistStaticThisXHPASTLinterRule                    | Use of `$this` in Static Context                                  |
| 14  | ArcanistPregQuoteMisuseXHPASTLinterRule               | Misuse of `preg_quote`                                            |
| 15  | ArcanistPHPOpenTagXHPASTLinterRule                    | Expected Open Tag                                                 |
| 16  | ArcanistTodoCommentXHPASTLinterRule                   | TODO Comment                                                      |
| 17  | ArcanistExitExpressionXHPASTLinterRule                | `exit` Used as Expression                                         |
| 18  | ArcanistCommentStyleXHPASTLinterRule                  | Comment Style                                                     |
| 19  | ArcanistClassFilenameMismatchXHPASTLinterRule         | Class-Filename Mismatch                                           |
| 20  | ArcanistTautologicalExpressionXHPASTLinterRule        | Tautological Expression                                           |
| 21  | ArcanistPlusOperatorOnStringsXHPASTLinterRule         | Not String Concatenation                                          |
| 22  | ArcanistDuplicateKeysInArrayXHPASTLinterRule          | Duplicate Keys in Array                                           |
| 23  | ArcanistReusedIteratorXHPASTLinterRule                | Reuse of Iterator Variable                                        |
| 24  | ArcanistBraceFormattingXHPASTLinterRule               | Brace Placement                                                   |
| 25  | ArcanistParenthesesSpacingXHPASTLinterRule            | Spaces Inside Parentheses                                         |
| 26  | ArcanistControlStatementSpacingXHPASTLinterRule       | Space After Control Statement                                     |
| 27  | ArcanistBinaryExpressionSpacingXHPASTLinterRule       | Space Around Binary Operator                                      |
| 28  | ArcanistArrayIndexSpacingXHPASTLinterRule             | Spacing Before Array Index                                        |
| 30  | ArcanistImplicitFallthroughXHPASTLinterRule           | Implicit Fallthrough                                              |
| 32  | ArcanistReusedAsIteratorXHPASTLinterRule              | Variable Reused As Iterator                                       |
| 34  | ArcanistCommentSpacingXHPASTLinterRule                | Comment Spaces                                                    |
| 36  | ArcanistSlownessXHPASTLinterRule                      | Slow Construct                                                    |
| 37  | ArcanistCallParenthesesXHPASTLinterRule               | Call Formatting                                                   |
| 38  | ArcanistDeclarationParenthesesXHPASTLinterRule        | Declaration Formatting                                            |
| 39  | ArcanistReusedIteratorReferenceXHPASTLinterRule       | Reuse of Iterator References                                      |
| 40  | ArcanistKeywordCasingXHPASTLinterRule                 | Keyword Conventions                                               |
| 41  | ArcanistDoubleQuoteXHPASTLinterRule                   | Unnecessary Double Quotes                                         |
| 42  | ArcanistElseIfUsageXHPASTLinterRule                   | `elseif` Usage                                                    |
| 43  | ArcanistSemicolonSpacingXHPASTLinterRule              | Semicolon Spacing                                                 |
| 44  | ArcanistConcatenationOperatorXHPASTLinterRule         | Concatenation Spacing                                             |
| 45  | ArcanistPHPCompatibilityXHPASTLinterRule              | PHP Compatibility                                                 |
| 46  | ArcanistLanguageConstructParenthesesXHPASTLinterRule  | Language Construct Parentheses                                    |
| 47  | ArcanistEmptyStatementXHPASTLinterRule                | Empty Block Statement                                             |
| 48  | ArcanistArraySeparatorXHPASTLinterRule                | Array Separator                                                   |
| 49  | ArcanistConstructorParenthesesXHPASTLinterRule        | Constructor Parentheses                                           |
| 50  | ArcanistDuplicateSwitchCaseXHPASTLinterRule           | Duplicate Case Statements                                         |
| 51  | ArcanistBlacklistedFunctionXHPASTLinterRule           | Use of Blacklisted Function                                       |
| 52  | ArcanistImplicitVisibilityXHPASTLinterRule            | Implicit Method Visibility                                        |
| 53  | ArcanistCallTimePassByReferenceXHPASTLinterRule       | Call-Time Pass-By-Reference                                       |
| 54  | ArcanistFormattedStringXHPASTLinterRule               | Formatted String                                                  |
| 55  | ArcanistUnnecessaryFinalModifierXHPASTLinterRule      | Unnecessary Final Modifier                                        |
| 56  | ArcanistUnnecessarySemicolonXHPASTLinterRule          | Unnecessary Semicolon                                             |
| 57  | ArcanistSelfMemberReferenceXHPASTLinterRule           | Self Member Reference                                             |
| 58  | ArcanistLogicalOperatorsXHPASTLinterRule              | Logical Operators                                                 |
| 59  | ArcanistInnerFunctionXHPASTLinterRule                 | Inner Functions                                                   |
| 60  | ArcanistDefaultParametersXHPASTLinterRule             | Default Parameters                                                |
| 61  | ArcanistLowercaseFunctionsXHPASTLinterRule            | Lowercase Functions                                               |
| 62  | ArcanistClassNameLiteralXHPASTLinterRule              | Class Name Literal                                                |
| 63  | ArcanistUselessOverridingMethodXHPASTLinterRule       | Useless Overriding Method                                         |
| 64  | ArcanistNoParentScopeXHPASTLinterRule                 | No Parent Scope                                                   |
| 65  | ArcanistAliasFunctionXHPASTLinterRule                 | Alias Functions                                                   |
| 66  | ArcanistCastSpacingXHPASTLinterRule                   | Cast Spacing                                                      |
| 67  | ArcanistToStringExceptionXHPASTLinterRule             | Throwing Exception in `__toString` Method                         |
| 68  | ArcanistLambdaFuncFunctionXHPASTLinterRule            | `__lambda_func` Function                                          |
| 69  | ArcanistInstanceOfOperatorXHPASTLinterRule            | `instanceof` Operator                                             |
| 70  | ArcanistInvalidDefaultParameterXHPASTLinterRule       | Invalid Default Parameter                                         |
| 71  | ArcanistModifierOrderingXHPASTLinterRule              | Modifier Ordering                                                 |
| 72  | ArcanistInvalidModifiersXHPASTLinterRule              | Invalid Modifiers                                                 |
| 73  | ArcanistUnaryPrefixExpressionSpacingXHPASTLinterRule  | Space After Unary Prefix Operator                                 |
| 74  | ArcanistObjectOperatorSpacingXHPASTLinterRule         | Object Operator Spacing                                           |
| 75  | ArcanistUnaryPostfixExpressionSpacingXHPASTLinterRule | Space Before Unary Postfix Operator                               |
| 76  | ArcanistArrayValueXHPASTLinterRule                    | Array Element                                                     |
| 77  | ArcanistListAssignmentXHPASTLinterRule                | List Assignment                                                   |
| 78  | ArcanistInlineHTMLXHPASTLinterRule                    | Inline HTML                                                       |
| 79  | ArcanistGlobalVariableXHPASTLinterRule                | Global Variables                                                  |
| 80  | ArcanistParseStrUseXHPASTLinterRule                   | Questionable Use of `parse_str`                                   |
| 81  | ArcanistNewlineAfterOpenTagXHPASTLinterRule           | Newline After PHP Open Tag                                        |
| 82  | ArcanistEmptyFileXHPASTLinterRule                     | Empty File                                                        |
| 83  | ArcanistParentMemberReferenceXHPASTLinterRule         | Parent Member Reference                                           |
| 84  | ArcanistArrayCombineXHPASTLinterRule                  | `array_combine()` Unreliable                                      |
| 85  | ArcanistDeprecationXHPASTLinterRule                   | Use of Deprecated Function                                        |
| 86  | ArcanistUnsafeDynamicStringXHPASTLinterRule           | Unsafe Usage of Dynamic String                                    |
| 87  | ArcanistRaggedClassTreeEdgeXHPASTLinterRule           | Class Not `abstract` Or `final`                                   |
| 88  | ArcanistClassExtendsObjectXHPASTLinterRule            | Class Not Extending `Phobject`                                    |
| 90  | ArcanistNestedNamespacesXHPASTLinterRule              | Nested `namespace` Statements                                     |
| 91  | ArcanistThisReassignmentXHPASTLinterRule              | `$this` Reassignment                                              |
| 92  | ArcanistUnexpectedReturnValueXHPASTLinterRule         | Unexpected `return` Value                                         |
| 97  | ArcanistUseStatementNamespacePrefixXHPASTLinterRule   | `use` Statement Namespace Prefix                                  |
| 99  | ArcanistUnnecessarySymbolAliasXHPASTLinterRule        | Unnecessary Symbol Alias                                          |
| 107 | ArcanistAbstractPrivateMethodXHPASTLinterRule         | `abstract` Method Cannot Be Declared `private`                    |
| 108 | ArcanistAbstractMethodBodyXHPASTLinterRule            | `abstract` Method Cannot Contain Body                             |
| 113 | ArcanistClassMustBeDeclaredAbstractXHPASTLinterRule   | `class` Containing `abstract` Methods Must Be Declared `abstract` |
+=====+=======================================================+===================================================================+

Diff Detail

Repository
rARC Arcanist
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

joshuaspence retitled this revision from to Add an `xhpast-linter-rules` command.
joshuaspence updated this object.
joshuaspence edited the test plan for this revision. (Show Details)
joshuaspence added a reviewer: epriestley.

I plan on eventually extending the "linter rule" concept to other linters such as ArcansitTextLinter, so we could generalize this to be arc linter-rules.

How about arc linters --rules xhpast or similar? I don't think this is of sufficiently general value to deserve a top-level command slot, and a --rules mode would generalize to other linters in the future.

Or I guess arc linters xhpast already does something, so maybe arc linters xhpast --rules.

Or just make arc linters xhpast output this table at the bottom?

joshuaspence edited edge metadata.

Still needs work

epriestley edited edge metadata.

Something in this general vein is broadly reasonable as far as I'm concerned.

src/lint/linter/ArcanistXHPASTLinter.php
67

This should probably be return something->something() rather than drawing directly to stdout. I think drawConsoleString() gives you a string now.

Hmm, I am having issues with __ being interpreted as underline.

Screenshot from 2015-11-25 07-05-43.png (1×1 px, 296 KB)

This revision is now accepted and ready to land.Nov 24 2015, 8:09 PM

This almost works... it seems like the table width is now wrong after D14569.

> arc linters xhpast
 CONFIGURED  xhpast (XHPAST Lint)

    Version 91

    Use XHPAST to enforce coding conventions on PHP source files.

    Configuration Options

    severity (optional map<string|int, string>)
      Provide a map from lint codes to adjusted severity levels: error,
      warning, advice, autofix or disabled.

    severity.rules (optional map<string, string>)
      Provide a map of regular expressions to severity levels. All matching
      codes have their severity adjusted.

    standard (optional string | list<string>)
      The coding standard(s) to apply.

    xhpast.php-version (optional string)
      PHP version to target.

    xhpast.php-version.windows (optional string)
      PHP version to target on Windows.

    xhpast.blacklisted.function (optional map<string, string>)
      Blacklisted functions which should not be used.

    xhpast.deprecated.functions (optional map<string, string>)
      Functions which should should be considered deprecated.

    xhpast.printf-functions (optional map<string, int>)
      `printf()`-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).

    xhpast.switchhook (optional string)
      Name of a concrete subclass of `ArcanistXHPASTLintSwitchHook` which
      tunes the analysis of `switch` statements for this linter.

    xhpast.naminghook (optional string)
      Name of a concrete subclass of `ArcanistXHPASTLintNamingHook` which
      enforces more granular naming convention rules for symbols.

    xhpast.dynamic-string.classes (optional map<string, string>)
      Classes which should should not be used because they represent the
      unsafe usage of dynamic strings.

    xhpast.dynamic-string.functions (optional map<string, string>)
      Functions which should should not be used because they represent the
      unsafe usage of dynamic strings.

    Linter Rules

+=====+=======================================================+===================================================================+
| ID  | Class                                                 | Name                                                              |
+=====+=======================================================+===================================================================+
| 1   | ArcanistSyntaxErrorXHPASTLinterRule                   | PHP Syntax Error!                                                 |
| 2   | ArcanistUnableToParseXHPASTLinterRule                 | Unable to Parse                                                   |
| 3   | ArcanistVariableVariableXHPASTLinterRule              | Use of Variable Variable                                          |
| 4   | ArcanistExtractUseXHPASTLinterRule                    | Use of extract                                                  |
| 5   | ArcanistUndeclaredVariableXHPASTLinterRule            | Use of Undeclared Variable                                        |
| 6   | ArcanistPHPShortTagXHPASTLinterRule                   | Use of Short Tag <?                                             |
| 7   | ArcanistPHPEchoTagXHPASTLinterRule                    | Use of Echo Tag <?=                                             |
| 8   | ArcanistPHPCloseTagXHPASTLinterRule                   | Use of Close Tag ?>                                             |
| 9   | ArcanistNamingConventionsXHPASTLinterRule             | Naming Conventions                                                |
| 10  | ArcanistImplicitConstructorXHPASTLinterRule           | Implicit Constructor                                              |
| 12  | ArcanistDynamicDefineXHPASTLinterRule                 | Dynamic define                                                  |
| 13  | ArcanistStaticThisXHPASTLinterRule                    | Use of $this in Static Context                                  |
| 14  | ArcanistPregQuoteMisuseXHPASTLinterRule               | Misuse of preg_quote                                            |
| 15  | ArcanistPHPOpenTagXHPASTLinterRule                    | Expected Open Tag                                                 |
| 16  | ArcanistTodoCommentXHPASTLinterRule                   | TODO Comment                                                      |
| 17  | ArcanistExitExpressionXHPASTLinterRule                | exit Used as Expression                                         |
| 18  | ArcanistCommentStyleXHPASTLinterRule                  | Comment Style                                                     |
| 19  | ArcanistClassFilenameMismatchXHPASTLinterRule         | Class-Filename Mismatch                                           |
| 20  | ArcanistTautologicalExpressionXHPASTLinterRule        | Tautological Expression                                           |
| 21  | ArcanistPlusOperatorOnStringsXHPASTLinterRule         | Not String Concatenation                                          |
| 22  | ArcanistDuplicateKeysInArrayXHPASTLinterRule          | Duplicate Keys in Array                                           |
| 23  | ArcanistReusedIteratorXHPASTLinterRule                | Reuse of Iterator Variable                                        |
| 24  | ArcanistBraceFormattingXHPASTLinterRule               | Brace Placement                                                   |
| 25  | ArcanistParenthesesSpacingXHPASTLinterRule            | Spaces Inside Parentheses                                         |
| 26  | ArcanistControlStatementSpacingXHPASTLinterRule       | Space After Control Statement                                     |
| 27  | ArcanistBinaryExpressionSpacingXHPASTLinterRule       | Space Around Binary Operator                                      |
| 28  | ArcanistArrayIndexSpacingXHPASTLinterRule             | Spacing Before Array Index                                        |
| 30  | ArcanistImplicitFallthroughXHPASTLinterRule           | Implicit Fallthrough                                              |
| 32  | ArcanistReusedAsIteratorXHPASTLinterRule              | Variable Reused As Iterator                                       |
| 34  | ArcanistCommentSpacingXHPASTLinterRule                | Comment Spaces                                                    |
| 36  | ArcanistSlownessXHPASTLinterRule                      | Slow Construct                                                    |
| 37  | ArcanistCallParenthesesXHPASTLinterRule               | Call Formatting                                                   |
| 38  | ArcanistDeclarationParenthesesXHPASTLinterRule        | Declaration Formatting                                            |
| 39  | ArcanistReusedIteratorReferenceXHPASTLinterRule       | Reuse of Iterator References                                      |
| 40  | ArcanistKeywordCasingXHPASTLinterRule                 | Keyword Conventions                                               |
| 41  | ArcanistDoubleQuoteXHPASTLinterRule                   | Unnecessary Double Quotes                                         |
| 42  | ArcanistElseIfUsageXHPASTLinterRule                   | elseif Usage                                                    |
| 43  | ArcanistSemicolonSpacingXHPASTLinterRule              | Semicolon Spacing                                                 |
| 44  | ArcanistConcatenationOperatorXHPASTLinterRule         | Concatenation Spacing                                             |
| 45  | ArcanistPHPCompatibilityXHPASTLinterRule              | PHP Compatibility                                                 |
| 46  | ArcanistLanguageConstructParenthesesXHPASTLinterRule  | Language Construct Parentheses                                    |
| 47  | ArcanistEmptyStatementXHPASTLinterRule                | Empty Block Statement                                             |
| 48  | ArcanistArraySeparatorXHPASTLinterRule                | Array Separator                                                   |
| 49  | ArcanistConstructorParenthesesXHPASTLinterRule        | Constructor Parentheses                                           |
| 50  | ArcanistDuplicateSwitchCaseXHPASTLinterRule           | Duplicate Case Statements                                         |
| 51  | ArcanistBlacklistedFunctionXHPASTLinterRule           | Use of Blacklisted Function                                       |
| 52  | ArcanistImplicitVisibilityXHPASTLinterRule            | Implicit Method Visibility                                        |
| 53  | ArcanistCallTimePassByReferenceXHPASTLinterRule       | Call-Time Pass-By-Reference                                       |
| 54  | ArcanistFormattedStringXHPASTLinterRule               | Formatted String                                                  |
| 55  | ArcanistUnnecessaryFinalModifierXHPASTLinterRule      | Unnecessary Final Modifier                                        |
| 56  | ArcanistUnnecessarySemicolonXHPASTLinterRule          | Unnecessary Semicolon                                             |
| 57  | ArcanistSelfMemberReferenceXHPASTLinterRule           | Self Member Reference                                             |
| 58  | ArcanistLogicalOperatorsXHPASTLinterRule              | Logical Operators                                                 |
| 59  | ArcanistInnerFunctionXHPASTLinterRule                 | Inner Functions                                                   |
| 60  | ArcanistDefaultParametersXHPASTLinterRule             | Default Parameters                                                |
| 61  | ArcanistLowercaseFunctionsXHPASTLinterRule            | Lowercase Functions                                               |
| 62  | ArcanistClassNameLiteralXHPASTLinterRule              | Class Name Literal                                                |
| 63  | ArcanistUselessOverridingMethodXHPASTLinterRule       | Useless Overriding Method                                         |
| 64  | ArcanistNoParentScopeXHPASTLinterRule                 | No Parent Scope                                                   |
| 65  | ArcanistAliasFunctionXHPASTLinterRule                 | Alias Functions                                                   |
| 66  | ArcanistCastSpacingXHPASTLinterRule                   | Cast Spacing                                                      |
| 67  | ArcanistToStringExceptionXHPASTLinterRule             | Throwing Exception in __toString Method                         |
| 68  | ArcanistLambdaFuncFunctionXHPASTLinterRule            | \__lambda_func Function                                          |
| 69  | ArcanistInstanceOfOperatorXHPASTLinterRule            | instanceof Operator                                             |
| 70  | ArcanistInvalidDefaultParameterXHPASTLinterRule       | Invalid Default Parameter                                         |
| 71  | ArcanistModifierOrderingXHPASTLinterRule              | Modifier Ordering                                                 |
| 72  | ArcanistInvalidModifiersXHPASTLinterRule              | Invalid Modifiers                                                 |
| 73  | ArcanistUnaryPrefixExpressionSpacingXHPASTLinterRule  | Space After Unary Prefix Operator                                 |
| 74  | ArcanistObjectOperatorSpacingXHPASTLinterRule         | Object Operator Spacing                                           |
| 75  | ArcanistUnaryPostfixExpressionSpacingXHPASTLinterRule | Space Before Unary Postfix Operator                               |
| 76  | ArcanistArrayValueXHPASTLinterRule                    | Array Element                                                     |
| 77  | ArcanistListAssignmentXHPASTLinterRule                | List Assignment                                                   |
| 78  | ArcanistInlineHTMLXHPASTLinterRule                    | Inline HTML                                                       |
| 79  | ArcanistGlobalVariableXHPASTLinterRule                | Global Variables                                                  |
| 80  | ArcanistParseStrUseXHPASTLinterRule                   | Questionable Use of parse_str                                   |
| 81  | ArcanistNewlineAfterOpenTagXHPASTLinterRule           | Newline After PHP Open Tag                                        |
| 82  | ArcanistEmptyFileXHPASTLinterRule                     | Empty File                                                        |
| 83  | ArcanistParentMemberReferenceXHPASTLinterRule         | Parent Member Reference                                           |
| 84  | ArcanistArrayCombineXHPASTLinterRule                  | array_combine() Unreliable                                      |
| 85  | ArcanistDeprecationXHPASTLinterRule                   | Use of Deprecated Function                                        |
| 86  | ArcanistUnsafeDynamicStringXHPASTLinterRule           | Unsafe Usage of Dynamic String                                    |
| 87  | ArcanistRaggedClassTreeEdgeXHPASTLinterRule           | Class Not abstract Or final                                   |
| 88  | ArcanistClassExtendsObjectXHPASTLinterRule            | Class Not Extending Phobject                                    |
| 90  | ArcanistNestedNamespacesXHPASTLinterRule              | Nested namespace Statements                                     |
| 91  | ArcanistThisReassignmentXHPASTLinterRule              | $this Reassignment                                              |
| 92  | ArcanistUnexpectedReturnValueXHPASTLinterRule         | Unexpected return Value                                         |
| 97  | ArcanistUseStatementNamespacePrefixXHPASTLinterRule   | use Statement Namespace Prefix                                  |
| 99  | ArcanistUnnecessarySymbolAliasXHPASTLinterRule        | Unnecessary Symbol Alias                                          |
| 107 | ArcanistAbstractPrivateMethodXHPASTLinterRule         | abstract Method Cannot Be Declared private                    |
| 108 | ArcanistAbstractMethodBodyXHPASTLinterRule            | abstract Method Cannot Contain Body                             |
| 113 | ArcanistClassMustBeDeclaredAbstractXHPASTLinterRule   | class Containing abstract Methods Must Be Declared abstract |
+=====+=======================================================+===================================================================+

Allow multiple additional sections to be injected.

epriestley edited edge metadata.
epriestley added inline comments.
src/workflow/ArcanistLintersWorkflow.php
176–181

Instead, use:

echo tsprintf(...);

That should fix the issue with reinterpreting __ as underscore.

This revision now requires changes to proceed.Nov 25 2015, 2:56 PM
src/workflow/ArcanistLintersWorkflow.php
176–181

echo $body seems to work, but echo tsprintf($body) doesn't.

joshuaspence edited edge metadata.
joshuaspence marked 3 inline comments as done.

Use tsprintf

I'd expect echo tsprintf('%s', $body); to work. $body should be a PhutilConsoleString which should be passed through %s intact.

I'd expect echo tsprintf('%s', $body); to work. $body should be a PhutilConsoleString which should be passed through %s intact.

I tried that but it destroyed newlines.

Oh, drawConsoleString() doesn't return a TerminalString. Just echo $body; it, I guess?

I'll go make tsprintf() automatically reduce PhutilConsoleView later but it's probably better to just echo than introduce a sort-of-sketchy, unsafe tsprintf() call.

(I think tsprintf() is generally headed in the right direction, but not all of the tsprintf()-related machinery knows about the other pieces yet.)

joshuaspence edited edge metadata.

Use plain-old echo

epriestley edited edge metadata.
This revision is now accepted and ready to land.Dec 1 2015, 12:20 PM
joshuaspence retitled this revision from Add an `xhpast-linter-rules` command to Add a table showing all XHPAST linter rules to the output of `arc linters xhpast`.Dec 1 2015, 7:23 PM
joshuaspence updated this object.
joshuaspence edited edge metadata.
This revision was automatically updated to reflect the committed changes.