Skip to content

Commit

Permalink
Update coding standards
Browse files Browse the repository at this point in the history
Use the WordPress coding standards as WebDevStudios-specific
standards have been depreciated.
  • Loading branch information
oddevan committed Jan 7, 2022
1 parent a1bbe2e commit 32b9a63
Show file tree
Hide file tree
Showing 4 changed files with 244 additions and 63 deletions.
64 changes: 64 additions & 0 deletions .phpcs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?xml version="1.0"?>
<ruleset name="WordPress Coding Standards">
<description>Apply WordPress Coding Standards</description>

<!-- Set the memory limit to 256M.
For most standard PHP configurations, this means the memory limit will temporarily be raised.
Ref: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Advanced-Usage#specifying-phpini-settings
-->
<ini name="memory_limit" value="256M"/>

<description>The ruleset for the WDS site documentation plugin</description>

<!-- Only check the PHP files. -->
<arg name="extensions" value="php" />

<!-- Report warnings, but don't block commits -->
<config name="ignore_warnings_on_exit" value="1"/>

<!-- Exclude the Composer Vendor directory. -->
<exclude-pattern>/vendor/*</exclude-pattern>

<!-- Exclude the lib Vendors directory. -->
<exclude-pattern>/lib/vendors/*</exclude-pattern>

<!-- Exclude the Node Modules directory. -->
<exclude-pattern>/node_modules/*</exclude-pattern>

<!-- Exclude PHPCS directory. -->
<exclude-pattern>/phpcs/*</exclude-pattern>

<!-- Exclude WPCS directory. -->
<exclude-pattern>/wpcs/*</exclude-pattern>

<config name="minimum_supported_wp_version" value="5.2.14"/>

<!-- WordPress-Core, WordPress-Docs & WordPress-Extra coding standards -->
<rule ref="WordPress">
<!-- Allow array short syntax. -->
<exclude name="Generic.Arrays.DisallowShortArraySyntax" />
</rule>

<!-- Check used textdomain for project -->
<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="array">
<element value="wds-site-documentation"/>
</property>
</properties>
</rule>

<!-- Verify that everything in the global namespace is prefixed with a theme specific prefix.
Multiple valid prefixes can be provided as a comma-delimited list. -->
<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
<properties>
<property name="prefixes" type="array" value="wds,wds_docs,WebDevStudios" />
</properties>
</rule>

<!-- WordPress Core currently supports PHP 5.6+. -->
<config name="testVersion" value="7.2-"/>

<!-- Only sniff the plugin. -->
<file>./</file>
</ruleset>
1 change: 0 additions & 1 deletion .phpcs.xml.dist

This file was deleted.

16 changes: 9 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
{
"name": "webdevstudios/wds-site-documentation",
"description": "A plugin to host site documentation in an easily accessible place in the WordPress dashboard.",
"license": "GPL-2.0-or-later",
"type": "wordpress-plugin",
"require-dev": {
"webdevstudios/php-coding-standards": "~1.3.0"
}
"name": "webdevstudios/wds-site-documentation",
"description": "A plugin to host site documentation in an easily accessible place in the WordPress dashboard.",
"license": "GPL-2.0-or-later",
"type": "wordpress-plugin",
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.1",
"phpcompatibility/phpcompatibility-wp": "^2.1.1",
"wp-coding-standards/wpcs": "~2.3.0"
}
}
226 changes: 171 additions & 55 deletions composer.lock

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

0 comments on commit 32b9a63

Please sign in to comment.