Skip to content

Instantly share code, notes, and snippets.

@textarcana
Created August 17, 2012 03:37
Show Gist options
  • Select an option

  • Save textarcana/3375708 to your computer and use it in GitHub Desktop.

Select an option

Save textarcana/3375708 to your computer and use it in GitHub Desktop.

Revisions

  1. Noah Sussman revised this gist Oct 16, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion js_sniffs.xml
    Original file line number Diff line number Diff line change
    @@ -18,7 +18,7 @@
    <rule ref="Squiz.WhiteSpace.LogicalOperatorSpacing"/>
    <rule ref="Squiz.Commenting.LongConditionClosingComment"/>
    <rule ref="Generic.PHP.LowerCaseConstant"/>
    <rule ref="Generic.Formatting.MultipleStatementAlignment"/>
    <!-- <rule ref="Generic.Formatting.MultipleStatementAlignment"/> -->
    <!-- <rule ref="Squiz.Formatting.OperatorBracket"/> -->
    <rule ref="Squiz.WhiteSpace.OperatorSpacing"/>
    <rule ref="Squiz.Commenting.PostStatementComment"/>
  2. Noah Sussman revised this gist Sep 12, 2012. 1 changed file with 6 additions and 6 deletions.
    12 changes: 6 additions & 6 deletions js_sniffs.xml
    Original file line number Diff line number Diff line change
    @@ -1,30 +1,30 @@
    <?xml version="1.0"?>
    <ruleset name="JavaScript">
    <description>Run all the sniffs that are applicable to JavaScript files.</description>
    <description>Run all the sniffs that are applicable to JavaScript files. See https://gist.github.com/3375708</description>

    <rule ref="Squiz.Operators.ComparisonOperatorUsage"/>
    <rule ref="Squiz.ControlStructures.ControlSignature"/>
    <rule ref="Squiz.WhiteSpace.ControlStructureSpacing"/>
    <rule ref="Squiz.PHP.DisallowInlineIf"/>
    <rule ref="Squiz.PHP.DisallowSizeFunctionsInLoops"/>
    <rule ref="Generic.WhiteSpace.DisallowTabIndent"/>
    <rule ref="Squiz.Commenting.FileComment"/>
    <!-- <rule ref="Squiz.Commenting.FileComment"/> -->
    <rule ref="Squiz.ControlStructures.ForLoopDeclaration"/>
    <rule ref="Squiz.WhiteSpace.FunctionClosingBraceSpace"/>
    <rule ref="Squiz.WhiteSpace.FunctionOpeningBraceSpace"/>
    <!-- <rule ref="Squiz.WhiteSpace.FunctionClosingBraceSpace"/> -->
    <!-- <rule ref="Squiz.WhiteSpace.FunctionOpeningBraceSpace"/> -->
    <rule ref="Squiz.Commenting.InlineComment"/>
    <rule ref="Generic.ControlStructures.InlineControlStructure"/>
    <rule ref="Generic.Files.LineEndings"/>
    <rule ref="Squiz.WhiteSpace.LogicalOperatorSpacing"/>
    <rule ref="Squiz.Commenting.LongConditionClosingComment"/>
    <rule ref="Generic.PHP.LowerCaseConstant"/>
    <rule ref="Generic.Formatting.MultipleStatementAlignment"/>
    <rule ref="Squiz.Formatting.OperatorBracket"/>
    <!-- <rule ref="Squiz.Formatting.OperatorBracket"/> -->
    <rule ref="Squiz.WhiteSpace.OperatorSpacing"/>
    <rule ref="Squiz.Commenting.PostStatementComment"/>
    <rule ref="Squiz.WhiteSpace.SemicolonSpacing"/>
    <rule ref="Squiz.WhiteSpace.SuperfluousWhitespace"/>
    <rule ref="Squiz.ControlStructures.SwitchDeclaration"/>
    <rule ref="Generic.Strings.UnnecessaryStringConcat"/>

    </ruleset>
    </ruleset>
  3. Noah Sussman revised this gist Aug 20, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion js_code_sniffs.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    ## JavaScript code sniffs available as of PHPCS v1.3.6

    Use the [js_sniffs.xml](#file_js_sniffs.xml) ruleset to run all these sniffs, eg `phpcs -v --ruleset=js_sniffs.xml`
    Use the [js_sniffs.xml](#file_js_sniffs.xml) ruleset to run all these sniffs, eg `phpcs -v --standard=js_sniffs.xml`

    0. [comparison operator usage](https://github.com/squizlabs/PHP_CodeSniffer/tree/master/CodeSniffer/Standards/Squiz/Sniffs/Operators/ComparisonOperatorUsageSniff.php)
    0. [control signature](https://github.com/squizlabs/PHP_CodeSniffer/tree/master/CodeSniffer/Standards/Squiz/Sniffs/ControlStructures/ControlSignatureSniff.php)
  4. Noah Sussman revised this gist Aug 17, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion js_code_sniffs.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    # JavaScript code sniffs available as of PHPCS v1.3.6
    ## JavaScript code sniffs available as of PHPCS v1.3.6

    Use the [js_sniffs.xml](#file_js_sniffs.xml) ruleset to run all these sniffs, eg `phpcs -v --ruleset=js_sniffs.xml`

  5. Noah Sussman revised this gist Aug 17, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion js_code_sniffs.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    # JavaScript code sniffs available as of PHPCS v1.3.6

    Use the [js_sniffs.xml](#file_ruleset.xml) ruleset to run all these sniffs, eg `phpcs -v --ruleset=js_sniffs.xml`
    Use the [js_sniffs.xml](#file_js_sniffs.xml) ruleset to run all these sniffs, eg `phpcs -v --ruleset=js_sniffs.xml`

    0. [comparison operator usage](https://github.com/squizlabs/PHP_CodeSniffer/tree/master/CodeSniffer/Standards/Squiz/Sniffs/Operators/ComparisonOperatorUsageSniff.php)
    0. [control signature](https://github.com/squizlabs/PHP_CodeSniffer/tree/master/CodeSniffer/Standards/Squiz/Sniffs/ControlStructures/ControlSignatureSniff.php)
  6. Noah Sussman revised this gist Aug 17, 2012. 2 changed files with 4 additions and 2 deletions.
    6 changes: 4 additions & 2 deletions js_code_sniffs.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,6 @@
    # JavaScript code sniffs as of PHPCS v1.3.6
    # JavaScript code sniffs available as of PHPCS v1.3.6

    Use the [js_sniffs.xml](#file_ruleset.xml) ruleset to run all these sniffs, eg `phpcs -v --ruleset=js_sniffs.xml`

    0. [comparison operator usage](https://github.com/squizlabs/PHP_CodeSniffer/tree/master/CodeSniffer/Standards/Squiz/Sniffs/Operators/ComparisonOperatorUsageSniff.php)
    0. [control signature](https://github.com/squizlabs/PHP_CodeSniffer/tree/master/CodeSniffer/Standards/Squiz/Sniffs/ControlStructures/ControlSignatureSniff.php)
    @@ -23,4 +25,4 @@
    0. [semicolon spacing](https://github.com/squizlabs/PHP_CodeSniffer/tree/master/CodeSniffer/Standards/Squiz/Sniffs/WhiteSpace/SemicolonSpacingSniff.php)
    0. [superfluous whitespace](https://github.com/squizlabs/PHP_CodeSniffer/tree/master/CodeSniffer/Standards/Squiz/Sniffs/WhiteSpace/SuperfluousWhitespaceSniff.php)
    0. [switch declaration](https://github.com/squizlabs/PHP_CodeSniffer/tree/master/CodeSniffer/Standards/Squiz/Sniffs/ControlStructures/SwitchDeclarationSniff.php)
    0. [unnecessary string concat](https://github.com/squizlabs/PHP_CodeSniffer/tree/master/CodeSniffer/Standards/Generic/Sniffs/Strings/UnnecessaryStringConcatSniff.php)
    0. [unnecessary string concat](https://github.com/squizlabs/PHP_CodeSniffer/tree/master/CodeSniffer/Standards/Generic/Sniffs/Strings/UnnecessaryStringConcatSniff.php)
    File renamed without changes.
  7. Noah Sussman revised this gist Aug 17, 2012. 1 changed file with 26 additions and 0 deletions.
    26 changes: 26 additions & 0 deletions js_code_sniffs.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,26 @@
    # JavaScript code sniffs as of PHPCS v1.3.6

    0. [comparison operator usage](https://github.com/squizlabs/PHP_CodeSniffer/tree/master/CodeSniffer/Standards/Squiz/Sniffs/Operators/ComparisonOperatorUsageSniff.php)
    0. [control signature](https://github.com/squizlabs/PHP_CodeSniffer/tree/master/CodeSniffer/Standards/Squiz/Sniffs/ControlStructures/ControlSignatureSniff.php)
    0. [control structure spacing](https://github.com/squizlabs/PHP_CodeSniffer/tree/master/CodeSniffer/Standards/Squiz/Sniffs/WhiteSpace/ControlStructureSpacingSniff.php)
    0. [disallow inline if](https://github.com/squizlabs/PHP_CodeSniffer/tree/master/CodeSniffer/Standards/Squiz/Sniffs/PHP/DisallowInlineIfSniff.php)
    0. [disallow size functions in loops](https://github.com/squizlabs/PHP_CodeSniffer/tree/master/CodeSniffer/Standards/Squiz/Sniffs/PHP/DisallowSizeFunctionsInLoopsSniff.php)
    0. [disallow tab indent](https://github.com/squizlabs/PHP_CodeSniffer/tree/master/CodeSniffer/Standards/Generic/Sniffs/WhiteSpace/DisallowTabIndentSniff.php)
    0. [file comment](https://github.com/squizlabs/PHP_CodeSniffer/tree/master/CodeSniffer/Standards/Squiz/Sniffs/Commenting/FileCommentSniff.php)
    0. [for loop declaration](https://github.com/squizlabs/PHP_CodeSniffer/tree/master/CodeSniffer/Standards/Squiz/Sniffs/ControlStructures/ForLoopDeclarationSniff.php)
    0. [function closing brace space](https://github.com/squizlabs/PHP_CodeSniffer/tree/master/CodeSniffer/Standards/Squiz/Sniffs/WhiteSpace/FunctionClosingBraceSpaceSniff.php)
    0. [function opening brace space](https://github.com/squizlabs/PHP_CodeSniffer/tree/master/CodeSniffer/Standards/Squiz/Sniffs/WhiteSpace/FunctionOpeningBraceSpaceSniff.php)
    0. [inline comment](https://github.com/squizlabs/PHP_CodeSniffer/tree/master/CodeSniffer/Standards/Squiz/Sniffs/Commenting/InlineCommentSniff.php)
    0. [inline control structure](https://github.com/squizlabs/PHP_CodeSniffer/tree/master/CodeSniffer/Standards/Generic/Sniffs/ControlStructures/InlineControlStructureSniff.php)
    0. [line endings](https://github.com/squizlabs/PHP_CodeSniffer/tree/master/CodeSniffer/Standards/Generic/Sniffs/Files/LineEndingsSniff.php)
    0. [logical operator spacing](https://github.com/squizlabs/PHP_CodeSniffer/tree/master/CodeSniffer/Standards/Squiz/Sniffs/WhiteSpace/LogicalOperatorSpacingSniff.php)
    0. [long condition closing comment](https://github.com/squizlabs/PHP_CodeSniffer/tree/master/CodeSniffer/Standards/Squiz/Sniffs/Commenting/LongConditionClosingCommentSniff.php)
    0. [lower case constant](https://github.com/squizlabs/PHP_CodeSniffer/tree/master/CodeSniffer/Standards/Generic/Sniffs/PHP/LowerCaseConstantSniff.php)
    0. [multiple statement alignment](https://github.com/squizlabs/PHP_CodeSniffer/tree/master/CodeSniffer/Standards/Generic/Sniffs/Formatting/MultipleStatementAlignmentSniff.php)
    0. [operator bracket](https://github.com/squizlabs/PHP_CodeSniffer/tree/master/CodeSniffer/Standards/Squiz/Sniffs/Formatting/OperatorBracketSniff.php)
    0. [operator spacing](https://github.com/squizlabs/PHP_CodeSniffer/tree/master/CodeSniffer/Standards/Squiz/Sniffs/WhiteSpace/OperatorSpacingSniff.php)
    0. [post statement comment](https://github.com/squizlabs/PHP_CodeSniffer/tree/master/CodeSniffer/Standards/Squiz/Sniffs/Commenting/PostStatementCommentSniff.php)
    0. [semicolon spacing](https://github.com/squizlabs/PHP_CodeSniffer/tree/master/CodeSniffer/Standards/Squiz/Sniffs/WhiteSpace/SemicolonSpacingSniff.php)
    0. [superfluous whitespace](https://github.com/squizlabs/PHP_CodeSniffer/tree/master/CodeSniffer/Standards/Squiz/Sniffs/WhiteSpace/SuperfluousWhitespaceSniff.php)
    0. [switch declaration](https://github.com/squizlabs/PHP_CodeSniffer/tree/master/CodeSniffer/Standards/Squiz/Sniffs/ControlStructures/SwitchDeclarationSniff.php)
    0. [unnecessary string concat](https://github.com/squizlabs/PHP_CodeSniffer/tree/master/CodeSniffer/Standards/Generic/Sniffs/Strings/UnnecessaryStringConcatSniff.php)
  8. Noah Sussman created this gist Aug 17, 2012.
    30 changes: 30 additions & 0 deletions ruleset.xml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,30 @@
    <?xml version="1.0"?>
    <ruleset name="JavaScript">
    <description>Run all the sniffs that are applicable to JavaScript files.</description>

    <rule ref="Squiz.Operators.ComparisonOperatorUsage"/>
    <rule ref="Squiz.ControlStructures.ControlSignature"/>
    <rule ref="Squiz.WhiteSpace.ControlStructureSpacing"/>
    <rule ref="Squiz.PHP.DisallowInlineIf"/>
    <rule ref="Squiz.PHP.DisallowSizeFunctionsInLoops"/>
    <rule ref="Generic.WhiteSpace.DisallowTabIndent"/>
    <rule ref="Squiz.Commenting.FileComment"/>
    <rule ref="Squiz.ControlStructures.ForLoopDeclaration"/>
    <rule ref="Squiz.WhiteSpace.FunctionClosingBraceSpace"/>
    <rule ref="Squiz.WhiteSpace.FunctionOpeningBraceSpace"/>
    <rule ref="Squiz.Commenting.InlineComment"/>
    <rule ref="Generic.ControlStructures.InlineControlStructure"/>
    <rule ref="Generic.Files.LineEndings"/>
    <rule ref="Squiz.WhiteSpace.LogicalOperatorSpacing"/>
    <rule ref="Squiz.Commenting.LongConditionClosingComment"/>
    <rule ref="Generic.PHP.LowerCaseConstant"/>
    <rule ref="Generic.Formatting.MultipleStatementAlignment"/>
    <rule ref="Squiz.Formatting.OperatorBracket"/>
    <rule ref="Squiz.WhiteSpace.OperatorSpacing"/>
    <rule ref="Squiz.Commenting.PostStatementComment"/>
    <rule ref="Squiz.WhiteSpace.SemicolonSpacing"/>
    <rule ref="Squiz.WhiteSpace.SuperfluousWhitespace"/>
    <rule ref="Squiz.ControlStructures.SwitchDeclaration"/>
    <rule ref="Generic.Strings.UnnecessaryStringConcat"/>

    </ruleset>