alma-gateway-for-woocommerce
Last commit date
assets
1 year ago
build
9 months ago
includes
9 months ago
languages
10 months ago
public
1 year ago
tests
9 months ago
vendor
9 months ago
LICENSE
4 years ago
alma-gateway-for-woocommerce.php
9 months ago
composer.json
9 months ago
phpcs.xml
1 year ago
readme.txt
9 months ago
uninstall.php
1 year ago
phpcs.xml
104 lines
| 1 | <?xml version="1.0"?> |
| 2 | <ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Alma Woocommerce Gateway" |
| 3 | xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/PHPCSStandards/PHP_CodeSniffer/master/phpcs.xsd"> |
| 4 | <description>A custom set of rules to check for Alma Woocommerce Gateway</description> |
| 5 | |
| 6 | <!-- Exclude WP Core folders and files from being checked. --> |
| 7 | <exclude-pattern>*/wp-admin/*</exclude-pattern> |
| 8 | <exclude-pattern>*/wp-includes/*</exclude-pattern> |
| 9 | <exclude-pattern>*/wp-*.php</exclude-pattern> |
| 10 | <exclude-pattern>*/index.php</exclude-pattern> |
| 11 | <exclude-pattern>*/xmlrpc.php</exclude-pattern> |
| 12 | <exclude-pattern>*/wp-content/plugins/*</exclude-pattern> |
| 13 | |
| 14 | <!-- Exclude tests. --> |
| 15 | <exclude-pattern>*/tests/*</exclude-pattern> |
| 16 | |
| 17 | <!-- Exclude widget --> |
| 18 | <exclude-pattern>*/assets/widget/*</exclude-pattern> |
| 19 | |
| 20 | <!-- Exclude the Composer Vendor directory. --> |
| 21 | <exclude-pattern>*/vendor/*</exclude-pattern> |
| 22 | |
| 23 | <!-- Exclude the Node Modules directory. --> |
| 24 | <exclude-pattern>*/node_modules/*</exclude-pattern> |
| 25 | |
| 26 | <!-- Exclude minified Javascript files. --> |
| 27 | <exclude-pattern>*.min.js</exclude-pattern> |
| 28 | <exclude-pattern>*.js</exclude-pattern> |
| 29 | |
| 30 | <!-- Exclude build --> |
| 31 | <exclude-pattern>*/build/*</exclude-pattern> |
| 32 | |
| 33 | <!-- Include the WordPress-Extra standard. --> |
| 34 | <rule ref="WordPress-Extra"> |
| 35 | <!-- |
| 36 | We may want a middle ground though. The best way to do this is add the |
| 37 | entire ruleset, then rule by rule, remove ones that don't suit a project. |
| 38 | We can do this by running `phpcs` with the '-s' flag, which allows us to |
| 39 | see the names of the sniffs reporting errors. |
| 40 | Once we know the sniff names, we can opt to exclude sniffs which don't |
| 41 | suit our project like so. |
| 42 | The below two examples just show how you can exclude rules. |
| 43 | They are not intended as advice about which sniffs to exclude. |
| 44 | --> |
| 45 | <exclude name="WordPress.WhiteSpace.ControlStructureSpacing"/> |
| 46 | <exclude name="WordPress.Security.EscapeOutput"/> |
| 47 | <exclude name="WordPress.DB.PreparedSQL.InterpolatedNotPrepared"/> |
| 48 | <exclude name="WordPress.Files.FileName"/> |
| 49 | </rule> |
| 50 | |
| 51 | <!-- Let's also check that everything is properly documented. --> |
| 52 | <!--rule ref="WordPress-Docs"/--> |
| 53 | |
| 54 | <!-- Add in some extra rules from other standards. --> |
| 55 | <rule ref="Generic.CodeAnalysis.UnusedFunctionParameter"/> |
| 56 | <rule ref="Generic.Commenting.Todo"/> |
| 57 | |
| 58 | <!-- Check for PHP cross-version compatibility. --> |
| 59 | <!-- |
| 60 | To enable this, the PHPCompatibilityWP standard needs |
| 61 | to be installed. |
| 62 | See the readme for installation instructions: |
| 63 | https://github.com/PHPCompatibility/PHPCompatibilityWP |
| 64 | For more information, also see: |
| 65 | https://github.com/PHPCompatibility/PHPCompatibility |
| 66 | --> |
| 67 | <config name="testVersion" value="5.6-"/> |
| 68 | <rule ref="PHPCompatibilityWP"/> |
| 69 | |
| 70 | <!-- |
| 71 | To get the optimal benefits of using WPCS, we should add a couple of |
| 72 | custom properties. |
| 73 | Adjust the values of these properties to fit our needs. |
| 74 | For information on additional custom properties available, check out |
| 75 | the wiki: |
| 76 | https://github.com/WordPress/WordPress-Coding-Standards/wiki/Customizable-sniff-properties |
| 77 | --> |
| 78 | <config name="minimum_supported_wp_version" value="4.4"/> |
| 79 | |
| 80 | <rule ref="WordPress.WP.I18n"> |
| 81 | <properties> |
| 82 | <property name="text_domain" type="array"> |
| 83 | <element value="alma-gateway-for-woocommerce"/> |
| 84 | </property> |
| 85 | </properties> |
| 86 | </rule> |
| 87 | |
| 88 | <rule ref="WordPress.NamingConventions.PrefixAllGlobals"> |
| 89 | <properties> |
| 90 | <property name="prefixes" type="array"> |
| 91 | <element value="Alma\Woocommerce"/> |
| 92 | <element value="alma"/> |
| 93 | </property> |
| 94 | |
| 95 | </properties> |
| 96 | </rule> |
| 97 | |
| 98 | <rule ref="Squiz.Commenting.FunctionCommentThrowTag"> |
| 99 | <exclude name="Squiz.Commenting.FunctionCommentThrowTag.WrongNumber"/> |
| 100 | </rule> |
| 101 | |
| 102 | <config name="ignore_warnings_on_exit" value="1"/> |
| 103 | </ruleset> |
| 104 |