Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default WordPress rules #2

Merged
merged 4 commits into from
Nov 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
vendor/
9 changes: 4 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@
],
"require": {
"php": ">=7.0",
"squizlabs/php_codesniffer": "^3.0.2"
},
"suggest": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.4.3"
"wp-coding-standards/wpcs": "^1.1",
"wimg/php-compatibility": "^9.0",
"dealerdirect/phpcodesniffer-composer-installer": "^0.5.0"
}
}
}
238 changes: 238 additions & 0 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 32 additions & 1 deletion src/WooCommerce-Core/ruleset.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,35 @@
<?xml version="1.0"?>
<ruleset name="WooCommerce Core">
<ruleset name="WooCommerce Core" namespace="WooCommerce">
<description>WooCommerce Core coding standards.</description>

<!-- PHPCompatibility -->
<rule ref="PHPCompatibility">
<exclude name="PHPCompatibility.PHP.NewFunctions.hash_equalsFound" />
<exclude name="PHPCompatibility.PHP.NewInterfaces.jsonserializableFound" />
<exclude name="PHPCompatibility.PHP.NewKeywords.t_namespaceFound" />
</rule>

<!-- WordPress -->
<rule ref="WordPress">
<exclude name="WordPress.DB.DirectDatabaseQuery.NoCaching" />
<exclude name="WordPress.DB.DirectDatabaseQuery.DirectQuery" />
<exclude name="WordPress.DB.DirectDatabaseQuery.SchemaChange" />
</rule>

<rule ref="WordPress.Security.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.Security.EscapeOutput">
<properties>
<property name="customEscapingFunctions" type="array" value="wc_help_tip,wc_sanitize_tooltip,wc_selected,wc_kses_notice" />
</properties>
</rule>

<rule ref="Squiz.Commenting">
<exclude name="Squiz.Commenting.LongConditionClosingComment" />
<exclude name="Squiz.Commenting.PostStatementComment" />
</rule>
</ruleset>