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
Update PHPCS default rule set #161
Changes from 8 commits
1e581ba
e4a3d1b
b64faae
d1047f2
c449067
4160c12
d0ac996
2f23c5c
c22db9a
64920e5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?xml version="1.0"?> | ||
<ruleset name="WordPress Coding Standards based custom ruleset for your plugin"> | ||
<description>Generally-applicable sniffs for WordPress plugins.</description> | ||
|
||
<!-- What to scan --> | ||
<file>.</file> | ||
<exclude-pattern>/vendor/</exclude-pattern> | ||
|
||
<!-- How to scan --> | ||
<!-- Usage instructions: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage --> | ||
<!-- Annotated ruleset: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml --> | ||
<arg value="sp"/> <!-- Show sniff and progress --> | ||
<arg name="basepath" value="./"/><!-- Strip the file paths down to the relevant bit --> | ||
<arg name="colors"/> | ||
<arg name="extensions" value="php"/> | ||
<arg name="parallel" value="8"/><!-- Enables parallel processing when available for faster results. --> | ||
|
||
<!-- Rules: Check PHP version compatibility --> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As per the earlier comments, using I'd also recommend adding a link to the PHPCompatibilityWP repo as a comment, again to help people to more easily find out more info: https://github.com/PHPCompatibility/PHPCompatibilityWP Maybe also add a link for more info about what the You may also want to add a comment saying that people can change the |
||
<!-- https://github.com/PHPCompatibility/PHPCompatibility#sniffing-your-code-for-compatibility-with-specific-php-versions --> | ||
<config name="testVersion" value="5.3-"/> | ||
<!-- https://github.com/PHPCompatibility/PHPCompatibilityWP --> | ||
<rule ref="PHPCompatibilityWP"/> | ||
|
||
<!-- Rules: WordPress Coding Standards --> | ||
<!-- https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards | ||
<!-- https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/wiki/Customizable-sniff-properties --> | ||
<config name="minimum_supported_wp_version" value="4.6"/> | ||
<rule ref="WordPress"> | ||
<exclude name="WordPress.VIP"/> | ||
</rule> | ||
<rule ref="WordPress.NamingConventions.PrefixAllGlobals"> | ||
<properties> | ||
<!-- Value: replace the function, class, and variable prefixes used. Separate multiple prefixes with a comma. --> | ||
<property name="prefixes" type="array" value="my-plugin"/> | ||
</properties> | ||
</rule> | ||
<rule ref="WordPress.WP.I18n"> | ||
<properties> | ||
<!-- Value: replace the text domain used. --> | ||
<property name="text_domain" type="array" value="my-plugin"/> | ||
</properties> | ||
</rule> | ||
<rule ref="WordPress.WhiteSpace.ControlStructureSpacing"> | ||
<properties> | ||
<property name="blank_line_check" value="true"/> | ||
</properties> | ||
</rule> | ||
</ruleset> |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,7 @@ phpunit.xml.dist | |
multisite.xml | ||
multisite.xml.dist | ||
phpcs.xml | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You may also want to add There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jrfnl thanks! I added .phpcs.xml but .gitignore is already in the file higher up. |
||
phpcs.xml.dist | ||
.phpcs.xml.dist | ||
README.md | ||
wp-cli.local.yml | ||
yarn.lock | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation is off here. Tabs vs spaces.