phpcs.xml.dist 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- This file contains coding standards directives for the Drupal Examples for
  3. Developers project. It uses the PHP Code Sniffer and Drupal Coder projects
  4. to enforce standard Drupal coding standards on this project. See
  5. https://www.drupal.org/node/2176147 for instructions on how to add a sniff
  6. here.-->
  7. <ruleset name="drupal_examples">
  8. <description>Default PHP CodeSniffer configuration for Examples for Developers.</description>
  9. <file>.</file>
  10. <arg name="extensions" value="css,inc,install,module,php,profile,test,theme"/>
  11. <rule ref="Drupal.Array"/>
  12. <rule ref="Drupal.CSS"/>
  13. <rule ref="Drupal.Classes"/>
  14. <rule ref="Drupal.Commenting">
  15. <exclude name="Drupal.Commenting.DocComment.MissingShort"/>
  16. <!-- TagsNotGrouped has false positives for @code/@endcode. See
  17. https://www.drupal.org/node/2502837 -->
  18. <exclude name="Drupal.Commenting.DocComment.TagsNotGrouped"/>
  19. <!-- We have to document hooks in a non-standard way in order to be
  20. informative -->
  21. <exclude name="Drupal.Commenting.HookComment.HookParamDoc"/>
  22. <exclude name="Drupal.Commenting.HookComment.HookReturnDoc"/>
  23. </rule>
  24. <rule ref="Drupal.ControlStructures"/>
  25. <rule ref="Drupal.Files"/>
  26. <rule ref="Drupal.Formatting"/>
  27. <rule ref="Drupal.Functions"/>
  28. <rule ref="Drupal.InfoFiles"/>
  29. <rule ref="Drupal.NamingConventions"/>
  30. <rule ref="Drupal.Strings"/>
  31. <rule ref="Drupal.WhiteSpace"/>
  32. <rule ref="Generic.Files.LineEndings"/>
  33. <rule ref="Generic.Formatting.SpaceAfterCast"/>
  34. <rule ref="Generic.Functions.FunctionCallArgumentSpacing"/>
  35. <rule ref="Generic.Functions.OpeningFunctionBraceKernighanRitchie"/>
  36. <rule ref="Generic.PHP.DeprecatedFunctions"/>
  37. <rule ref="Generic.PHP.DisallowShortOpenTag"/>
  38. <rule ref="Generic.PHP.LowerCaseKeyword"/>
  39. <rule ref="Generic.PHP.UpperCaseConstant"/>
  40. <rule ref="Generic.WhiteSpace.DisallowTabIndent"/>
  41. <rule ref="MySource.Debug.DebugCode"/>
  42. <rule ref="PSR2.Classes.PropertyDeclaration"/>
  43. <rule ref="Squiz.Arrays.ArrayBracketSpacing"/>
  44. <rule ref="Squiz.CSS.ClassDefinitionOpeningBraceSpace"/>
  45. <rule ref="Squiz.CSS.ColonSpacing"/>
  46. <rule ref="Squiz.CSS.DisallowMultipleStyleDefinitions"/>
  47. <rule ref="Squiz.CSS.EmptyClassDefinition"/>
  48. <rule ref="Squiz.CSS.EmptyStyleDefinition"/>
  49. <rule ref="Squiz.CSS.MissingColon"/>
  50. <rule ref="Squiz.CSS.SemicolonSpacing"/>
  51. <rule ref="Squiz.Commenting.DocCommentAlignment"/>
  52. <rule ref="Squiz.ControlStructures.ForEachLoopDeclaration"/>
  53. <rule ref="Squiz.ControlStructures.ForLoopDeclaration"/>
  54. <rule ref="Squiz.PHP.LowercasePHPFunctions"/>
  55. <rule ref="Squiz.PHP.NonExecutableCode"/>
  56. <rule ref="Squiz.Scope.MethodScope"/>
  57. <rule ref="Squiz.WhiteSpace.LanguageConstructSpacing"/>
  58. <rule ref="Squiz.WhiteSpace.SemicolonSpacing"/>
  59. <rule ref="Squiz.WhiteSpace.SuperfluousWhitespace"/>
  60. <rule ref="Zend.Files.ClosingTag"/>
  61. </ruleset>