diff --git a/CHANGELOG-coder.txt b/CHANGELOG.txt similarity index 100% rename from CHANGELOG-coder.txt rename to CHANGELOG.txt diff --git a/README-coder.txt b/README-coder.txt deleted file mode 100644 index fac2c772df2ba1c1b9f57618748399413242c440..0000000000000000000000000000000000000000 --- a/README-coder.txt +++ /dev/null @@ -1,22 +0,0 @@ - -Developer Module that assists with code review and version upgrade that -supports a plug-in extensible hook system so contributed modules can -define additional review standards. - -Built-in support for: - - Drupal Coding Standards - http://drupal.org/node/318 - - Handle text in a secure fashion - http://drupal.org/node/28984 - - Converting 4.6.x modules to 4.7.x - http://drupal.org/node/22218 - - Converting 4.7.x modules to 5.x - http://drupal.org/node/64279 - -Installation ------------- - -Copy coder.module to your module directory and then enable on the admin -modules page. Enable the modules that admin/config/development/coder/settings -works on, then view the coder results page at coder. - -Author ------- -Doug Green -douggreen@douggreenconsulting.com diff --git a/README.txt b/README.txt index 0ac1ca4c1410d5f6aa8809964140bcaf020e3897..fac2c772df2ba1c1b9f57618748399413242c440 100644 --- a/README.txt +++ b/README.txt @@ -1,71 +1,22 @@ -------------------------------------------------------------------------------- - Drupal Code Sniffer -------------------------------------------------------------------------------- -Drupal Code Sniffer (drupalcs) is a coding standard validation tool for Drupal -and contributed modules/themes. - -Online documentation: http://drupal.org/node/1419980 +Developer Module that assists with code review and version upgrade that +supports a plug-in extensible hook system so contributed modules can +define additional review standards. +Built-in support for: + - Drupal Coding Standards - http://drupal.org/node/318 + - Handle text in a secure fashion - http://drupal.org/node/28984 + - Converting 4.6.x modules to 4.7.x - http://drupal.org/node/22218 + - Converting 4.7.x modules to 5.x - http://drupal.org/node/64279 Installation ------------ -Requirements: - - PEAR - - PHPCS - -- Install PEAR ( http://pear.php.net/manual/en/installation.php ) -- Install PHPCS ( http://pear.php.net/package/PHP_CodeSniffer ) -- Sym-link the drupalcs directory into the standards folder for PHP_CodeSniffer. - The code for that looks like this: - -$> sudo ln -sv /path/to/drupalcs/Drupal $(pear config-get php_dir)/PHP/CodeSniffer/Standards - -Please see the online documentation for more detailed instructions: - - http://drupal.org/node/1419988 - -Installation: Drush -------------------- - -While drupalcs can be used as a standalone set of rules for PHP_CodeSniffer, -drush command support is included to facilitate ease of use, installation, -and leveraging of drush features such as site aliasing. - -Extract the contents of the drupalcs project into one of the locations specified -in the drush README.txt COMMANDS section, such as the subdirectory of the -.drush folder in your home directory. For other alternatives, please see -http://drupal.org/node/1419988 - -Usage (running in a shell) --------------------------- - -$> phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme /path/to/drupal_module - -Usage (drush) -------------- - -$> drush drupalcs sites/all/modules/custom - -Working with Editors --------------------- -Drupal Code Sniffer can be used with various editors. - -Editors: - -eclipse: http://drupal.org/node/1420004 -Komodo: http://drupal.org/node/1419996 -Netbeans: http://drupal.org/node/1420008 -Sublime Text: http://drupal.org/node/1419996 -vim: http://drupal.org/node/1419996 - - -Attention ---------- -This is still a draft!! -Please cross check with http://drupal.org/coding-standards and -http://drupal.org/project/coder if the validation is correct +Copy coder.module to your module directory and then enable on the admin +modules page. Enable the modules that admin/config/development/coder/settings +works on, then view the coder results page at coder. -Known Issues: -Documentation Tags just rarly supported - there are many missing / disabled sniffs \ No newline at end of file +Author +------ +Doug Green +douggreen@douggreenconsulting.com diff --git a/Drupal/CommentParser/FunctionCommentParser.php b/coder_sniffer/Drupal/CommentParser/FunctionCommentParser.php similarity index 100% rename from Drupal/CommentParser/FunctionCommentParser.php rename to coder_sniffer/Drupal/CommentParser/FunctionCommentParser.php diff --git a/Drupal/CommentParser/ParameterElement.php b/coder_sniffer/Drupal/CommentParser/ParameterElement.php similarity index 100% rename from Drupal/CommentParser/ParameterElement.php rename to coder_sniffer/Drupal/CommentParser/ParameterElement.php diff --git a/Drupal/CommentParser/ReturnElement.php b/coder_sniffer/Drupal/CommentParser/ReturnElement.php similarity index 100% rename from Drupal/CommentParser/ReturnElement.php rename to coder_sniffer/Drupal/CommentParser/ReturnElement.php diff --git a/Drupal/Docs/Files/IncludingFileStandard.xml b/coder_sniffer/Drupal/Docs/Files/IncludingFileStandard.xml similarity index 100% rename from Drupal/Docs/Files/IncludingFileStandard.xml rename to coder_sniffer/Drupal/Docs/Files/IncludingFileStandard.xml diff --git a/Drupal/Docs/Files/LineLengthStandard.xml b/coder_sniffer/Drupal/Docs/Files/LineLengthStandard.xml similarity index 100% rename from Drupal/Docs/Files/LineLengthStandard.xml rename to coder_sniffer/Drupal/Docs/Files/LineLengthStandard.xml diff --git a/Drupal/Docs/Functions/FunctionCallArgumentSpacingStandard.xml b/coder_sniffer/Drupal/Docs/Functions/FunctionCallArgumentSpacingStandard.xml similarity index 100% rename from Drupal/Docs/Functions/FunctionCallArgumentSpacingStandard.xml rename to coder_sniffer/Drupal/Docs/Functions/FunctionCallArgumentSpacingStandard.xml diff --git a/Drupal/Docs/Functions/FunctionCallSignatureStandard.xml b/coder_sniffer/Drupal/Docs/Functions/FunctionCallSignatureStandard.xml similarity index 100% rename from Drupal/Docs/Functions/FunctionCallSignatureStandard.xml rename to coder_sniffer/Drupal/Docs/Functions/FunctionCallSignatureStandard.xml diff --git a/Drupal/Docs/Functions/ValidDefaultValueStandard.xml b/coder_sniffer/Drupal/Docs/Functions/ValidDefaultValueStandard.xml similarity index 100% rename from Drupal/Docs/Functions/ValidDefaultValueStandard.xml rename to coder_sniffer/Drupal/Docs/Functions/ValidDefaultValueStandard.xml diff --git a/Drupal/Docs/NamingConventions/ValidClassNameStandard.xml b/coder_sniffer/Drupal/Docs/NamingConventions/ValidClassNameStandard.xml similarity index 100% rename from Drupal/Docs/NamingConventions/ValidClassNameStandard.xml rename to coder_sniffer/Drupal/Docs/NamingConventions/ValidClassNameStandard.xml diff --git a/Drupal/Docs/NamingConventions/ValidFunctionNameStandard.xml b/coder_sniffer/Drupal/Docs/NamingConventions/ValidFunctionNameStandard.xml similarity index 100% rename from Drupal/Docs/NamingConventions/ValidFunctionNameStandard.xml rename to coder_sniffer/Drupal/Docs/NamingConventions/ValidFunctionNameStandard.xml diff --git a/Drupal/Sniffs/Array/ArraySniff.php b/coder_sniffer/Drupal/Sniffs/Array/ArraySniff.php similarity index 100% rename from Drupal/Sniffs/Array/ArraySniff.php rename to coder_sniffer/Drupal/Sniffs/Array/ArraySniff.php diff --git a/Drupal/Sniffs/CSS/ClassDefinitionClosingBraceSpaceSniff.php b/coder_sniffer/Drupal/Sniffs/CSS/ClassDefinitionClosingBraceSpaceSniff.php similarity index 100% rename from Drupal/Sniffs/CSS/ClassDefinitionClosingBraceSpaceSniff.php rename to coder_sniffer/Drupal/Sniffs/CSS/ClassDefinitionClosingBraceSpaceSniff.php diff --git a/Drupal/Sniffs/CSS/ClassDefinitionNameSpacingSniff.php b/coder_sniffer/Drupal/Sniffs/CSS/ClassDefinitionNameSpacingSniff.php similarity index 100% rename from Drupal/Sniffs/CSS/ClassDefinitionNameSpacingSniff.php rename to coder_sniffer/Drupal/Sniffs/CSS/ClassDefinitionNameSpacingSniff.php diff --git a/Drupal/Sniffs/CSS/ClassDefinitionOpeningBraceSpaceSniff.php b/coder_sniffer/Drupal/Sniffs/CSS/ClassDefinitionOpeningBraceSpaceSniff.php similarity index 100% rename from Drupal/Sniffs/CSS/ClassDefinitionOpeningBraceSpaceSniff.php rename to coder_sniffer/Drupal/Sniffs/CSS/ClassDefinitionOpeningBraceSpaceSniff.php diff --git a/Drupal/Sniffs/CSS/ColourDefinitionSniff.php b/coder_sniffer/Drupal/Sniffs/CSS/ColourDefinitionSniff.php similarity index 100% rename from Drupal/Sniffs/CSS/ColourDefinitionSniff.php rename to coder_sniffer/Drupal/Sniffs/CSS/ColourDefinitionSniff.php diff --git a/Drupal/Sniffs/CSS/IndentationSniff.php b/coder_sniffer/Drupal/Sniffs/CSS/IndentationSniff.php similarity index 100% rename from Drupal/Sniffs/CSS/IndentationSniff.php rename to coder_sniffer/Drupal/Sniffs/CSS/IndentationSniff.php diff --git a/Drupal/Sniffs/CSS/MissingColonSniff.php b/coder_sniffer/Drupal/Sniffs/CSS/MissingColonSniff.php similarity index 100% rename from Drupal/Sniffs/CSS/MissingColonSniff.php rename to coder_sniffer/Drupal/Sniffs/CSS/MissingColonSniff.php diff --git a/Drupal/Sniffs/CSS/StyleSortSniff.php b/coder_sniffer/Drupal/Sniffs/CSS/StyleSortSniff.php similarity index 100% rename from Drupal/Sniffs/CSS/StyleSortSniff.php rename to coder_sniffer/Drupal/Sniffs/CSS/StyleSortSniff.php diff --git a/Drupal/Sniffs/Classes/ClassCreateInstanceSniff.php b/coder_sniffer/Drupal/Sniffs/Classes/ClassCreateInstanceSniff.php similarity index 100% rename from Drupal/Sniffs/Classes/ClassCreateInstanceSniff.php rename to coder_sniffer/Drupal/Sniffs/Classes/ClassCreateInstanceSniff.php diff --git a/Drupal/Sniffs/Classes/ClassDeclarationSniff.php b/coder_sniffer/Drupal/Sniffs/Classes/ClassDeclarationSniff.php similarity index 100% rename from Drupal/Sniffs/Classes/ClassDeclarationSniff.php rename to coder_sniffer/Drupal/Sniffs/Classes/ClassDeclarationSniff.php diff --git a/Drupal/Sniffs/Classes/PrivateKeywordSniff.php b/coder_sniffer/Drupal/Sniffs/Classes/PrivateKeywordSniff.php similarity index 100% rename from Drupal/Sniffs/Classes/PrivateKeywordSniff.php rename to coder_sniffer/Drupal/Sniffs/Classes/PrivateKeywordSniff.php diff --git a/Drupal/Sniffs/Classes/VarKeywordSniff.php b/coder_sniffer/Drupal/Sniffs/Classes/VarKeywordSniff.php similarity index 100% rename from Drupal/Sniffs/Classes/VarKeywordSniff.php rename to coder_sniffer/Drupal/Sniffs/Classes/VarKeywordSniff.php diff --git a/Drupal/Sniffs/Commenting/DocCommentAlignmentSniff.php b/coder_sniffer/Drupal/Sniffs/Commenting/DocCommentAlignmentSniff.php similarity index 100% rename from Drupal/Sniffs/Commenting/DocCommentAlignmentSniff.php rename to coder_sniffer/Drupal/Sniffs/Commenting/DocCommentAlignmentSniff.php diff --git a/Drupal/Sniffs/Commenting/FileCommentSniff.php b/coder_sniffer/Drupal/Sniffs/Commenting/FileCommentSniff.php similarity index 100% rename from Drupal/Sniffs/Commenting/FileCommentSniff.php rename to coder_sniffer/Drupal/Sniffs/Commenting/FileCommentSniff.php diff --git a/Drupal/Sniffs/Commenting/FunctionCommentSniff.php b/coder_sniffer/Drupal/Sniffs/Commenting/FunctionCommentSniff.php similarity index 100% rename from Drupal/Sniffs/Commenting/FunctionCommentSniff.php rename to coder_sniffer/Drupal/Sniffs/Commenting/FunctionCommentSniff.php diff --git a/Drupal/Sniffs/Commenting/InlineCommentSniff.php b/coder_sniffer/Drupal/Sniffs/Commenting/InlineCommentSniff.php similarity index 100% rename from Drupal/Sniffs/Commenting/InlineCommentSniff.php rename to coder_sniffer/Drupal/Sniffs/Commenting/InlineCommentSniff.php diff --git a/Drupal/Sniffs/ControlStructures/ControlSignatureSniff.php b/coder_sniffer/Drupal/Sniffs/ControlStructures/ControlSignatureSniff.php similarity index 100% rename from Drupal/Sniffs/ControlStructures/ControlSignatureSniff.php rename to coder_sniffer/Drupal/Sniffs/ControlStructures/ControlSignatureSniff.php diff --git a/Drupal/Sniffs/ControlStructures/ElseIfSniff.php b/coder_sniffer/Drupal/Sniffs/ControlStructures/ElseIfSniff.php similarity index 100% rename from Drupal/Sniffs/ControlStructures/ElseIfSniff.php rename to coder_sniffer/Drupal/Sniffs/ControlStructures/ElseIfSniff.php diff --git a/Drupal/Sniffs/ControlStructures/ElseNewlineSniff.php b/coder_sniffer/Drupal/Sniffs/ControlStructures/ElseNewlineSniff.php similarity index 100% rename from Drupal/Sniffs/ControlStructures/ElseNewlineSniff.php rename to coder_sniffer/Drupal/Sniffs/ControlStructures/ElseNewlineSniff.php diff --git a/Drupal/Sniffs/ControlStructures/InlineControlStructureSniff.php b/coder_sniffer/Drupal/Sniffs/ControlStructures/InlineControlStructureSniff.php similarity index 100% rename from Drupal/Sniffs/ControlStructures/InlineControlStructureSniff.php rename to coder_sniffer/Drupal/Sniffs/ControlStructures/InlineControlStructureSniff.php diff --git a/Drupal/Sniffs/ControlStructures/TemplateControlStructureSniff.php b/coder_sniffer/Drupal/Sniffs/ControlStructures/TemplateControlStructureSniff.php similarity index 100% rename from Drupal/Sniffs/ControlStructures/TemplateControlStructureSniff.php rename to coder_sniffer/Drupal/Sniffs/ControlStructures/TemplateControlStructureSniff.php diff --git a/Drupal/Sniffs/Files/LineLengthSniff.php b/coder_sniffer/Drupal/Sniffs/Files/LineLengthSniff.php similarity index 100% rename from Drupal/Sniffs/Files/LineLengthSniff.php rename to coder_sniffer/Drupal/Sniffs/Files/LineLengthSniff.php diff --git a/Drupal/Sniffs/Files/TxtFileLineLengthSniff.php b/coder_sniffer/Drupal/Sniffs/Files/TxtFileLineLengthSniff.php similarity index 100% rename from Drupal/Sniffs/Files/TxtFileLineLengthSniff.php rename to coder_sniffer/Drupal/Sniffs/Files/TxtFileLineLengthSniff.php diff --git a/Drupal/Sniffs/Formatting/DisallowCloseTagSniff.php b/coder_sniffer/Drupal/Sniffs/Formatting/DisallowCloseTagSniff.php similarity index 100% rename from Drupal/Sniffs/Formatting/DisallowCloseTagSniff.php rename to coder_sniffer/Drupal/Sniffs/Formatting/DisallowCloseTagSniff.php diff --git a/Drupal/Sniffs/Formatting/MultiLineAssignmentSniff.php b/coder_sniffer/Drupal/Sniffs/Formatting/MultiLineAssignmentSniff.php similarity index 100% rename from Drupal/Sniffs/Formatting/MultiLineAssignmentSniff.php rename to coder_sniffer/Drupal/Sniffs/Formatting/MultiLineAssignmentSniff.php diff --git a/Drupal/Sniffs/Formatting/SpaceColonSniff.php b/coder_sniffer/Drupal/Sniffs/Formatting/SpaceColonSniff.php similarity index 100% rename from Drupal/Sniffs/Formatting/SpaceColonSniff.php rename to coder_sniffer/Drupal/Sniffs/Formatting/SpaceColonSniff.php diff --git a/Drupal/Sniffs/Formatting/SpaceUnaryOperatorSniff.php b/coder_sniffer/Drupal/Sniffs/Formatting/SpaceUnaryOperatorSniff.php similarity index 100% rename from Drupal/Sniffs/Formatting/SpaceUnaryOperatorSniff.php rename to coder_sniffer/Drupal/Sniffs/Formatting/SpaceUnaryOperatorSniff.php diff --git a/Drupal/Sniffs/Functions/FunctionDeclarationSniff.php b/coder_sniffer/Drupal/Sniffs/Functions/FunctionDeclarationSniff.php similarity index 100% rename from Drupal/Sniffs/Functions/FunctionDeclarationSniff.php rename to coder_sniffer/Drupal/Sniffs/Functions/FunctionDeclarationSniff.php diff --git a/Drupal/Sniffs/InfoFiles/ClassFilesSniff.php b/coder_sniffer/Drupal/Sniffs/InfoFiles/ClassFilesSniff.php similarity index 100% rename from Drupal/Sniffs/InfoFiles/ClassFilesSniff.php rename to coder_sniffer/Drupal/Sniffs/InfoFiles/ClassFilesSniff.php diff --git a/Drupal/Sniffs/InfoFiles/RequiredSniff.php b/coder_sniffer/Drupal/Sniffs/InfoFiles/RequiredSniff.php similarity index 100% rename from Drupal/Sniffs/InfoFiles/RequiredSniff.php rename to coder_sniffer/Drupal/Sniffs/InfoFiles/RequiredSniff.php diff --git a/Drupal/Sniffs/NamingConventions/KeywordLowerCaseSniff.php b/coder_sniffer/Drupal/Sniffs/NamingConventions/KeywordLowerCaseSniff.php similarity index 100% rename from Drupal/Sniffs/NamingConventions/KeywordLowerCaseSniff.php rename to coder_sniffer/Drupal/Sniffs/NamingConventions/KeywordLowerCaseSniff.php diff --git a/Drupal/Sniffs/NamingConventions/ValidClassNameSniff.php b/coder_sniffer/Drupal/Sniffs/NamingConventions/ValidClassNameSniff.php similarity index 100% rename from Drupal/Sniffs/NamingConventions/ValidClassNameSniff.php rename to coder_sniffer/Drupal/Sniffs/NamingConventions/ValidClassNameSniff.php diff --git a/Drupal/Sniffs/NamingConventions/ValidFunctionNameSniff.php b/coder_sniffer/Drupal/Sniffs/NamingConventions/ValidFunctionNameSniff.php similarity index 100% rename from Drupal/Sniffs/NamingConventions/ValidFunctionNameSniff.php rename to coder_sniffer/Drupal/Sniffs/NamingConventions/ValidFunctionNameSniff.php diff --git a/Drupal/Sniffs/NamingConventions/ValidGlobalSniff.php b/coder_sniffer/Drupal/Sniffs/NamingConventions/ValidGlobalSniff.php similarity index 100% rename from Drupal/Sniffs/NamingConventions/ValidGlobalSniff.php rename to coder_sniffer/Drupal/Sniffs/NamingConventions/ValidGlobalSniff.php diff --git a/Drupal/Sniffs/NamingConventions/ValidVariableNameSniff.php b/coder_sniffer/Drupal/Sniffs/NamingConventions/ValidVariableNameSniff.php similarity index 100% rename from Drupal/Sniffs/NamingConventions/ValidVariableNameSniff.php rename to coder_sniffer/Drupal/Sniffs/NamingConventions/ValidVariableNameSniff.php diff --git a/Drupal/Sniffs/Semantics/BrSniff.php b/coder_sniffer/Drupal/Sniffs/Semantics/BrSniff.php similarity index 100% rename from Drupal/Sniffs/Semantics/BrSniff.php rename to coder_sniffer/Drupal/Sniffs/Semantics/BrSniff.php diff --git a/Drupal/Sniffs/Semantics/FunctionCall.php b/coder_sniffer/Drupal/Sniffs/Semantics/FunctionCall.php similarity index 100% rename from Drupal/Sniffs/Semantics/FunctionCall.php rename to coder_sniffer/Drupal/Sniffs/Semantics/FunctionCall.php diff --git a/Drupal/Sniffs/Semantics/FunctionTSniff.php b/coder_sniffer/Drupal/Sniffs/Semantics/FunctionTSniff.php similarity index 100% rename from Drupal/Sniffs/Semantics/FunctionTSniff.php rename to coder_sniffer/Drupal/Sniffs/Semantics/FunctionTSniff.php diff --git a/Drupal/Sniffs/Semantics/FunctionWatchdogSniff.php b/coder_sniffer/Drupal/Sniffs/Semantics/FunctionWatchdogSniff.php similarity index 100% rename from Drupal/Sniffs/Semantics/FunctionWatchdogSniff.php rename to coder_sniffer/Drupal/Sniffs/Semantics/FunctionWatchdogSniff.php diff --git a/Drupal/Sniffs/Semantics/InstallHooksSniff.php b/coder_sniffer/Drupal/Sniffs/Semantics/InstallHooksSniff.php similarity index 100% rename from Drupal/Sniffs/Semantics/InstallHooksSniff.php rename to coder_sniffer/Drupal/Sniffs/Semantics/InstallHooksSniff.php diff --git a/Drupal/Sniffs/Semantics/InstallTSniff.php b/coder_sniffer/Drupal/Sniffs/Semantics/InstallTSniff.php similarity index 100% rename from Drupal/Sniffs/Semantics/InstallTSniff.php rename to coder_sniffer/Drupal/Sniffs/Semantics/InstallTSniff.php diff --git a/Drupal/Sniffs/Semantics/LStringTranslatableSniff.php b/coder_sniffer/Drupal/Sniffs/Semantics/LStringTranslatableSniff.php similarity index 100% rename from Drupal/Sniffs/Semantics/LStringTranslatableSniff.php rename to coder_sniffer/Drupal/Sniffs/Semantics/LStringTranslatableSniff.php diff --git a/Drupal/Sniffs/Semantics/PregSecuritySniff.php b/coder_sniffer/Drupal/Sniffs/Semantics/PregSecuritySniff.php similarity index 100% rename from Drupal/Sniffs/Semantics/PregSecuritySniff.php rename to coder_sniffer/Drupal/Sniffs/Semantics/PregSecuritySniff.php diff --git a/Drupal/Sniffs/Semantics/RemoteAddressSniff.php b/coder_sniffer/Drupal/Sniffs/Semantics/RemoteAddressSniff.php similarity index 100% rename from Drupal/Sniffs/Semantics/RemoteAddressSniff.php rename to coder_sniffer/Drupal/Sniffs/Semantics/RemoteAddressSniff.php diff --git a/Drupal/Sniffs/Semantics/TInHookMenuSniff.php b/coder_sniffer/Drupal/Sniffs/Semantics/TInHookMenuSniff.php similarity index 100% rename from Drupal/Sniffs/Semantics/TInHookMenuSniff.php rename to coder_sniffer/Drupal/Sniffs/Semantics/TInHookMenuSniff.php diff --git a/Drupal/Sniffs/Semantics/TInHookSchemaSniff.php b/coder_sniffer/Drupal/Sniffs/Semantics/TInHookSchemaSniff.php similarity index 100% rename from Drupal/Sniffs/Semantics/TInHookSchemaSniff.php rename to coder_sniffer/Drupal/Sniffs/Semantics/TInHookSchemaSniff.php diff --git a/Drupal/Sniffs/Strings/ConcatenationSpacingSniff.php b/coder_sniffer/Drupal/Sniffs/Strings/ConcatenationSpacingSniff.php similarity index 100% rename from Drupal/Sniffs/Strings/ConcatenationSpacingSniff.php rename to coder_sniffer/Drupal/Sniffs/Strings/ConcatenationSpacingSniff.php diff --git a/Drupal/Sniffs/Strings/UnnecessaryStringConcatSniff.php b/coder_sniffer/Drupal/Sniffs/Strings/UnnecessaryStringConcatSniff.php similarity index 100% rename from Drupal/Sniffs/Strings/UnnecessaryStringConcatSniff.php rename to coder_sniffer/Drupal/Sniffs/Strings/UnnecessaryStringConcatSniff.php diff --git a/Drupal/Sniffs/WhiteSpace/CloseBracketSpacingSniff.php b/coder_sniffer/Drupal/Sniffs/WhiteSpace/CloseBracketSpacingSniff.php similarity index 100% rename from Drupal/Sniffs/WhiteSpace/CloseBracketSpacingSniff.php rename to coder_sniffer/Drupal/Sniffs/WhiteSpace/CloseBracketSpacingSniff.php diff --git a/Drupal/Sniffs/WhiteSpace/EmptyLinesSniff.php b/coder_sniffer/Drupal/Sniffs/WhiteSpace/EmptyLinesSniff.php similarity index 100% rename from Drupal/Sniffs/WhiteSpace/EmptyLinesSniff.php rename to coder_sniffer/Drupal/Sniffs/WhiteSpace/EmptyLinesSniff.php diff --git a/Drupal/Sniffs/WhiteSpace/FileEndSniff.php b/coder_sniffer/Drupal/Sniffs/WhiteSpace/FileEndSniff.php similarity index 100% rename from Drupal/Sniffs/WhiteSpace/FileEndSniff.php rename to coder_sniffer/Drupal/Sniffs/WhiteSpace/FileEndSniff.php diff --git a/Drupal/Sniffs/WhiteSpace/LineEndingSniff.php b/coder_sniffer/Drupal/Sniffs/WhiteSpace/LineEndingSniff.php similarity index 100% rename from Drupal/Sniffs/WhiteSpace/LineEndingSniff.php rename to coder_sniffer/Drupal/Sniffs/WhiteSpace/LineEndingSniff.php diff --git a/Drupal/Sniffs/WhiteSpace/ObjectOperatorIndentSniff.php b/coder_sniffer/Drupal/Sniffs/WhiteSpace/ObjectOperatorIndentSniff.php similarity index 100% rename from Drupal/Sniffs/WhiteSpace/ObjectOperatorIndentSniff.php rename to coder_sniffer/Drupal/Sniffs/WhiteSpace/ObjectOperatorIndentSniff.php diff --git a/Drupal/Sniffs/WhiteSpace/ObjectOperatorSpacingSniff.php b/coder_sniffer/Drupal/Sniffs/WhiteSpace/ObjectOperatorSpacingSniff.php similarity index 100% rename from Drupal/Sniffs/WhiteSpace/ObjectOperatorSpacingSniff.php rename to coder_sniffer/Drupal/Sniffs/WhiteSpace/ObjectOperatorSpacingSniff.php diff --git a/Drupal/Sniffs/WhiteSpace/OpenBracketSpacingSniff.php b/coder_sniffer/Drupal/Sniffs/WhiteSpace/OpenBracketSpacingSniff.php similarity index 100% rename from Drupal/Sniffs/WhiteSpace/OpenBracketSpacingSniff.php rename to coder_sniffer/Drupal/Sniffs/WhiteSpace/OpenBracketSpacingSniff.php diff --git a/Drupal/Sniffs/WhiteSpace/ScopeClosingBraceSniff.php b/coder_sniffer/Drupal/Sniffs/WhiteSpace/ScopeClosingBraceSniff.php similarity index 100% rename from Drupal/Sniffs/WhiteSpace/ScopeClosingBraceSniff.php rename to coder_sniffer/Drupal/Sniffs/WhiteSpace/ScopeClosingBraceSniff.php diff --git a/Drupal/Sniffs/WhiteSpace/ScopeIndentSniff.php b/coder_sniffer/Drupal/Sniffs/WhiteSpace/ScopeIndentSniff.php similarity index 100% rename from Drupal/Sniffs/WhiteSpace/ScopeIndentSniff.php rename to coder_sniffer/Drupal/Sniffs/WhiteSpace/ScopeIndentSniff.php diff --git a/Drupal/drupalcs.info b/coder_sniffer/Drupal/drupalcs.info similarity index 100% rename from Drupal/drupalcs.info rename to coder_sniffer/Drupal/drupalcs.info diff --git a/Drupal/ruleset.xml b/coder_sniffer/Drupal/ruleset.xml similarity index 100% rename from Drupal/ruleset.xml rename to coder_sniffer/Drupal/ruleset.xml diff --git a/coder_sniffer/README.txt b/coder_sniffer/README.txt new file mode 100644 index 0000000000000000000000000000000000000000..0ac1ca4c1410d5f6aa8809964140bcaf020e3897 --- /dev/null +++ b/coder_sniffer/README.txt @@ -0,0 +1,71 @@ +------------------------------------------------------------------------------- + Drupal Code Sniffer +------------------------------------------------------------------------------- + +Drupal Code Sniffer (drupalcs) is a coding standard validation tool for Drupal +and contributed modules/themes. + +Online documentation: http://drupal.org/node/1419980 + + +Installation +------------ + +Requirements: + - PEAR + - PHPCS + +- Install PEAR ( http://pear.php.net/manual/en/installation.php ) +- Install PHPCS ( http://pear.php.net/package/PHP_CodeSniffer ) +- Sym-link the drupalcs directory into the standards folder for PHP_CodeSniffer. + The code for that looks like this: + +$> sudo ln -sv /path/to/drupalcs/Drupal $(pear config-get php_dir)/PHP/CodeSniffer/Standards + +Please see the online documentation for more detailed instructions: + + http://drupal.org/node/1419988 + +Installation: Drush +------------------- + +While drupalcs can be used as a standalone set of rules for PHP_CodeSniffer, +drush command support is included to facilitate ease of use, installation, +and leveraging of drush features such as site aliasing. + +Extract the contents of the drupalcs project into one of the locations specified +in the drush README.txt COMMANDS section, such as the subdirectory of the +.drush folder in your home directory. For other alternatives, please see +http://drupal.org/node/1419988 + +Usage (running in a shell) +-------------------------- + +$> phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme /path/to/drupal_module + +Usage (drush) +------------- + +$> drush drupalcs sites/all/modules/custom + +Working with Editors +-------------------- +Drupal Code Sniffer can be used with various editors. + +Editors: + +eclipse: http://drupal.org/node/1420004 +Komodo: http://drupal.org/node/1419996 +Netbeans: http://drupal.org/node/1420008 +Sublime Text: http://drupal.org/node/1419996 +vim: http://drupal.org/node/1419996 + + +Attention +--------- +This is still a draft!! +Please cross check with http://drupal.org/coding-standards and +http://drupal.org/project/coder if the validation is correct + +Known Issues: +Documentation Tags just rarly supported - there are many missing / disabled sniffs \ No newline at end of file diff --git a/Test/bad.css b/coder_sniffer/Test/bad.css similarity index 100% rename from Test/bad.css rename to coder_sniffer/Test/bad.css diff --git a/Test/bad.info b/coder_sniffer/Test/bad.info similarity index 100% rename from Test/bad.info rename to coder_sniffer/Test/bad.info diff --git a/Test/bad.install b/coder_sniffer/Test/bad.install similarity index 100% rename from Test/bad.install rename to coder_sniffer/Test/bad.install diff --git a/Test/bad.module b/coder_sniffer/Test/bad.module similarity index 100% rename from Test/bad.module rename to coder_sniffer/Test/bad.module diff --git a/Test/bad.php b/coder_sniffer/Test/bad.php similarity index 100% rename from Test/bad.php rename to coder_sniffer/Test/bad.php diff --git a/Test/bad.tpl.php b/coder_sniffer/Test/bad.tpl.php similarity index 100% rename from Test/bad.tpl.php rename to coder_sniffer/Test/bad.tpl.php diff --git a/Test/bad2.info b/coder_sniffer/Test/bad2.info similarity index 100% rename from Test/bad2.info rename to coder_sniffer/Test/bad2.info diff --git a/Test/good.css b/coder_sniffer/Test/good.css similarity index 100% rename from Test/good.css rename to coder_sniffer/Test/good.css diff --git a/Test/good.install b/coder_sniffer/Test/good.install similarity index 100% rename from Test/good.install rename to coder_sniffer/Test/good.install diff --git a/Test/good.php b/coder_sniffer/Test/good.php similarity index 100% rename from Test/good.php rename to coder_sniffer/Test/good.php diff --git a/Test/good.tpl.php b/coder_sniffer/Test/good.tpl.php similarity index 100% rename from Test/good.tpl.php rename to coder_sniffer/Test/good.tpl.php diff --git a/drupalcs.drush.inc b/coder_sniffer/drupalcs.drush.inc similarity index 100% rename from drupalcs.drush.inc rename to coder_sniffer/drupalcs.drush.inc