setup coding standards

This commit is contained in:
David Remer 2020-08-27 11:07:01 +03:00
parent 16501ee765
commit 61d24eede6
3 changed files with 19 additions and 8 deletions

View file

@ -29,4 +29,4 @@ jobs:
- name: Run test suite
run: ./vendor/bin/phpunit
- name: Run cs
run: ./vendor/bin/phpcs src modules.local/ppcp-wc-gateway/src/ modules.local/ppcp-webhooks/src/ modules.local/ppcp-button/src/ modules.local/ppcp-onboarding/src/ modules.local/ppcp-subscription/src --standard=Inpsyde
run: ./vendor/bin/phpcs src modules.local/ppcp-wc-gateway/src/ modules.local/ppcp-webhooks/src/ modules.local/ppcp-button/src/ modules.local/ppcp-onboarding/src/ modules.local/ppcp-subscription/src

View file

@ -34,7 +34,7 @@
"ext-json": "*"
},
"require-dev": {
"inpsyde/php-coding-standards": "^1",
"woocommerce/woocommerce-sniffs": "^0.1.0",
"phpunit/phpunit": "^9.1",
"brain/monkey": "^2.4"
},

View file

@ -1,10 +1,21 @@
<?xml version="1.0"?>
<ruleset name="Inpsyde Coding Standard">
<rule ref="Inpsyde"/>
<file>./src</file>
<file>./modules.local</file>
<ruleset name="WooCommerce Coding Standards">
<description>My projects ruleset.</description>
<!-- Configs -->
<config name="minimum_supported_wp_version" value="4.7" />
<config name="testVersion" value="7.2-" />
<exclude-pattern>*\.(inc|css|js)$</exclude-pattern>
<exclude-pattern>*\.(inc|css|js)$</exclude-pattern>
<!-- Rules -->
<rule ref="WooCommerce-Core" />
<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="array" value="woocommerce-paypal-commerce-gateway" />
</properties>
</rule>
<rule ref="PHPCompatibility">
<exclude-pattern>tests/</exclude-pattern>
</rule>
</ruleset>