ruleset.xml 4.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <?xml version="1.0"?>
  2. <!--
  3. /**
  4. * Copyright © Magento, Inc. All rights reserved.
  5. * See COPYING.txt for license details.
  6. */
  7. -->
  8. <ruleset name="Magento">
  9. <description>Custom Magento coding standard.</description>
  10. <rule ref="PSR2"/>
  11. <rule ref="PSR2.Files.ClosingTag">
  12. <exclude-pattern>*.phtml</exclude-pattern>
  13. </rule>
  14. <rule ref="Magento.Files.LineLength">
  15. <properties>
  16. <property name="lineLimit" value="120"/>
  17. <property name="absoluteLineLimit" value="120"/>
  18. </properties>
  19. </rule>
  20. <rule ref="Magento.LanguageConstructs.LanguageConstructs">
  21. <include-pattern>*/app/code/*\.(?!phtml)</include-pattern>
  22. </rule>
  23. <rule ref="Magento.LiteralNamespaces.LiteralNamespaces">
  24. <exclude-pattern>*/_files/*</exclude-pattern>
  25. </rule>
  26. <rule ref="Magento.Annotation.MethodArguments">
  27. <exclude-pattern>*/_files/*</exclude-pattern>
  28. <exclude-pattern>*/Test/*</exclude-pattern>
  29. <exclude-pattern>*Test.php</exclude-pattern>
  30. <exclude-pattern>*/Magento/Inventory*/*</exclude-pattern>
  31. </rule>
  32. <rule ref="Magento.Annotation.MethodAnnotationStructure">
  33. <include-pattern>*\.(php)</include-pattern>
  34. <exclude-pattern>*/Test/*</exclude-pattern>
  35. <exclude-pattern>*Test.php</exclude-pattern>
  36. <exclude-pattern>*/_files/*</exclude-pattern>
  37. <exclude-pattern>*/Magento/Inventory*/*</exclude-pattern>
  38. </rule>
  39. <rule ref="Magento.Annotation.ClassAnnotationStructure">
  40. <include-pattern>*\.(php)</include-pattern>
  41. <exclude-pattern>*/Test/*</exclude-pattern>
  42. <exclude-pattern>*Test.php</exclude-pattern>
  43. <exclude-pattern>*/_files/*</exclude-pattern>
  44. <exclude-pattern>*/Magento/Inventory*/*</exclude-pattern>
  45. </rule>
  46. <rule ref="Magento.Functions.OutputBuffering">
  47. <include-pattern>*/(app/code|vendor|setup/src|lib/internal/Magento)/*</include-pattern>
  48. <exclude-pattern>*/lib/internal/Magento/Framework/Image/Adapter/Gd2.php</exclude-pattern>
  49. <exclude-pattern>*/lib/internal/Magento/Framework/View/Result/Page.php</exclude-pattern>
  50. <exclude-pattern>*/lib/internal/Magento/Framework/View/TemplateEngine/Php.php</exclude-pattern>
  51. <exclude-pattern>*/Test/Unit/*</exclude-pattern>
  52. </rule>
  53. <rule ref="Magento.Variables.GlobalVariables">
  54. <include-pattern>*/(app/code|vendor|setup/src)/*</include-pattern>
  55. <exclude-pattern>*/setup/src/Magento/Setup/Controller/WebConfiguration.php</exclude-pattern>
  56. <exclude-pattern>*/setup/src/Magento/Setup/Mvc/Bootstrap/InitParamListener.php</exclude-pattern>
  57. <exclude-pattern>*/app/code/Magento/Eav/Model/Attribute/Data/File.php</exclude-pattern>
  58. <exclude-pattern>*/app/code/Magento/Config/Model/Config/Reader/Source/Deployed/SettingChecker.php</exclude-pattern>
  59. <exclude-pattern>*/app/code/Magento/Backend/App/Area/FrontNameResolver.php</exclude-pattern>
  60. <exclude-pattern>*/app/code/Magento/Indexer/Console/Command/AbstractIndexerCommand.php</exclude-pattern>
  61. <exclude-pattern>*/app/code/Magento/Catalog/Model/Product/Option/Type/File/ValidatorFile.php</exclude-pattern>
  62. <exclude-pattern>*/app/code/Magento/Cron/Console/Command/CronCommand.php</exclude-pattern>
  63. <exclude-pattern>*/app/code/Magento/ImportExport/Controller/Adminhtml/Import/Validate.php</exclude-pattern>
  64. <exclude-pattern>*/app/code/Magento/OfflineShipping/Model/ResourceModel/Carrier/Tablerate.php</exclude-pattern>
  65. <exclude-pattern>*/app/code/Magento/Store/Model/Store.php</exclude-pattern>
  66. <exclude-pattern>*/app/code/Magento/Config/Model/Config/Processor/EnvironmentPlaceholder.php</exclude-pattern>
  67. <exclude-pattern>*/app/code/Magento/Config/Model/Config/Backend/Email/Logo.php</exclude-pattern>
  68. <exclude-pattern>*/app/code/Magento/Config/Model/Config/Backend/File/RequestData.php</exclude-pattern>
  69. <exclude-pattern>*/app/code/Magento/Config/App/Config/Source/EnvironmentConfigSource.php</exclude-pattern>
  70. <exclude-pattern>*/app/code/Magento/Theme/Controller/Adminhtml/Design/Config/FileUploader/Save.php</exclude-pattern>
  71. <exclude-pattern>*/app/code/Magento/Customer/Model/Metadata/Form/File.php</exclude-pattern>
  72. <exclude-pattern>*/app/code/Magento/Customer/Model/FileUploader.php</exclude-pattern>
  73. <exclude-pattern>*/app/code/Magento/Customer/Controller/Adminhtml/File/Address/Upload.php</exclude-pattern>
  74. <exclude-pattern>*/app/code/Magento/Customer/Controller/Adminhtml/File/Customer/Upload.php</exclude-pattern>
  75. <exclude-pattern>*/Test/Unit/*</exclude-pattern>
  76. </rule>
  77. <rule ref="Generic.PHP.CharacterBeforePHPOpeningTag"/>
  78. <rule ref="Generic.Functions.CallTimePassByReference"/>
  79. <rule ref="Generic.PHP.DeprecatedFunctions"/>
  80. <rule ref="Squiz.Commenting.DocCommentAlignment"/>
  81. <rule ref="Squiz.Functions.GlobalFunction"/>
  82. <rule ref="Squiz.WhiteSpace.LogicalOperatorSpacing"/>
  83. </ruleset>