Merge pull request woocommerce/woocommerce-beta-tester#17 from woocommerce/add/dev-tools
Dev tools
This commit is contained in:
commit
2514f9dd0a
|
@ -0,0 +1,24 @@
|
|||
# This file is for unifying the coding style for different editors and IDEs
|
||||
# editorconfig.org
|
||||
|
||||
# WordPress Coding Standards
|
||||
# https://make.wordpress.org/core/handbook/coding-standards/
|
||||
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
indent_size = 4
|
||||
tab_width = 4
|
||||
indent_style = tab
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[*.txt]
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
[*.{md,json,yml}]
|
||||
trim_trailing_whitespace = false
|
||||
indent_style = space
|
||||
indent_size = 2
|
|
@ -0,0 +1,2 @@
|
|||
vendor/
|
||||
node_modules/
|
|
@ -0,0 +1,51 @@
|
|||
{
|
||||
"name": "woocommerce/woocommerce-beta-tester",
|
||||
"description": "Run the beta versions of WooCommerce.",
|
||||
"homepage": "https://woocommerce.com/",
|
||||
"type": "wordpress-plugin",
|
||||
"license": "GPL-3.0-or-later",
|
||||
"prefer-stable": true,
|
||||
"minimum-stability": "dev",
|
||||
"require": {
|
||||
"composer/installers": "~1.2"
|
||||
},
|
||||
"require-dev": {
|
||||
"squizlabs/php_codesniffer": "*",
|
||||
"wp-coding-standards/wpcs": "^0.14",
|
||||
"phpunit/phpunit": "6.*",
|
||||
"woocommerce/woocommerce-git-hooks": "*",
|
||||
"woocommerce/woocommerce-sniffs": "*",
|
||||
"wimg/php-compatibility": "^8.0",
|
||||
"dealerdirect/phpcodesniffer-composer-installer": "^0.4.3"
|
||||
},
|
||||
"scripts": {
|
||||
"pre-update-cmd": [
|
||||
"WooCommerce\\GitHooks\\Hooks::preHooks"
|
||||
],
|
||||
"pre-install-cmd": [
|
||||
"WooCommerce\\GitHooks\\Hooks::preHooks"
|
||||
],
|
||||
"post-install-cmd": [
|
||||
"WooCommerce\\GitHooks\\Hooks::postHooks"
|
||||
],
|
||||
"post-update-cmd": [
|
||||
"WooCommerce\\GitHooks\\Hooks::postHooks"
|
||||
],
|
||||
"test": [
|
||||
"phpunit"
|
||||
],
|
||||
"phpcs": [
|
||||
"phpcs -s -p"
|
||||
],
|
||||
"phpcbf": [
|
||||
"phpcbf -p"
|
||||
]
|
||||
},
|
||||
"extra": {
|
||||
"scripts-description": {
|
||||
"test": "Run unit tests",
|
||||
"phpcs": "Analyze code against the WordPress coding standards with PHP_CodeSniffer",
|
||||
"phpcbf": "Fix coding standards warnings/errors automatically with PHP Code Beautifier"
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,51 @@
|
|||
<?xml version="1.0"?>
|
||||
<ruleset name="WordPress Coding Standards">
|
||||
<!-- See https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml -->
|
||||
<!-- See https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/blob/develop/WordPress-Core/ruleset.xml -->
|
||||
|
||||
<description>WooCommerce dev PHP_CodeSniffer ruleset.</description>
|
||||
|
||||
<!-- Exclude paths -->
|
||||
<exclude-pattern>*/node_modules/*</exclude-pattern>
|
||||
<exclude-pattern>*/vendor/*</exclude-pattern>
|
||||
|
||||
<!-- Configs -->
|
||||
<config name="minimum_supported_wp_version" value="4.7" />
|
||||
<config name="testVersion" value="5.2-"/>
|
||||
|
||||
<!-- Rules -->
|
||||
<rule ref="WooCommerce-Core" />
|
||||
<rule ref="PHPCompatibility">
|
||||
<exclude name="PHPCompatibility.PHP.NewFunctions.hash_equalsFound" />
|
||||
<exclude name="PHPCompatibility.PHP.NewInterfaces.jsonserializableFound" />
|
||||
<exclude name="PHPCompatibility.PHP.NewKeywords.t_namespaceFound" />
|
||||
<exclude-pattern>tests/</exclude-pattern>
|
||||
</rule>
|
||||
|
||||
<rule ref="WordPress">
|
||||
<exclude name="WordPress.VIP.DirectDatabaseQuery.NoCaching" />
|
||||
<exclude name="WordPress.VIP.DirectDatabaseQuery.DirectQuery" />
|
||||
<exclude name="WordPress.VIP.DirectDatabaseQuery.SchemaChange" />
|
||||
<exclude name="WordPress.VIP.FileSystemWritesDisallow.file_ops_fwrite" />
|
||||
<exclude name="WordPress.VIP.OrderByRand" />
|
||||
<exclude name="WordPress.VIP.RestrictedFunctions" />
|
||||
<exclude name="WordPress.VIP.RestrictedVariables.user_meta__wpdb__usermeta" />
|
||||
<exclude name="WordPress.VIP.PostsPerPage.posts_per_page_posts_per_page" />
|
||||
<exclude name="WordPress.VIP.RestrictedVariables.cache_constraints___COOKIE" />
|
||||
</rule>
|
||||
<rule ref="WordPress.VIP.ValidatedSanitizedInput">
|
||||
<properties>
|
||||
<property name="customSanitizingFunctions" type="array" value="wc_clean,wc_sanitize_tooltip,wc_format_decimal,wc_stock_amount,wc_sanitize_permalink,wc_sanitize_textarea" />
|
||||
</properties>
|
||||
</rule>
|
||||
<rule ref="WordPress.XSS.EscapeOutput">
|
||||
<properties>
|
||||
<property name="customEscapingFunctions" type="array" value="wc_help_tip,wc_sanitize_tooltip" />
|
||||
</properties>
|
||||
</rule>
|
||||
<rule ref="WordPress.WP.I18n">
|
||||
<properties>
|
||||
<property name="text_domain" type="array" value="woocommerce-beta-tester" />
|
||||
</properties>
|
||||
</rule>
|
||||
</ruleset>
|
Loading…
Reference in New Issue