Warning: DOMDocument::loadHTML(): Tag template invalid in Entity, line: 12 in /home/customer/www/salferrarello.com/public_html/wp-content/plugins/gistpress/includes/class-gistpress.php on line 466
Warning: DOMDocument::loadHTML(): Tag svg invalid in Entity, line: 14 in /home/customer/www/salferrarello.com/public_html/wp-content/plugins/gistpress/includes/class-gistpress.php on line 466
Warning: DOMDocument::loadHTML(): Tag path invalid in Entity, line: 15 in /home/customer/www/salferrarello.com/public_html/wp-content/plugins/gistpress/includes/class-gistpress.php on line 466
Warning: DOMDocument::loadHTML(): Tag template invalid in Entity, line: 27 in /home/customer/www/salferrarello.com/public_html/wp-content/plugins/gistpress/includes/class-gistpress.php on line 466
Warning: DOMDocument::loadHTML(): Tag svg invalid in Entity, line: 29 in /home/customer/www/salferrarello.com/public_html/wp-content/plugins/gistpress/includes/class-gistpress.php on line 466
Warning: DOMDocument::loadHTML(): Tag path invalid in Entity, line: 30 in /home/customer/www/salferrarello.com/public_html/wp-content/plugins/gistpress/includes/class-gistpress.php on line 466
I’ve been using PHP CodeSniffer to help me following coding standards. The WordPress Coding Standards (wpcs) are a great resource and the basis of the rules I follow. I have made a few modifications based on my personal preferences.
You can download this to your project directly from the command line with
curl -O https://gist.githubusercontent.com/salcode/57b1d8018624c73b10015faa29e6acb2/raw/.phpcs.xml.dist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<ruleset name="Iron Code Studio"> | |
<description>The PHP CodeSniffer rules used by Sal Ferrarello (salcode) for his Iron Code Studio projects.</description> | |
<!-- | |
You can download this file directly | |
to your project from the command-line with | |
curl -O https://gist.githubusercontent.com/salcode/57b1d8018624c73b10015faa29e6acb2/raw/.phpcs.xml.dist | |
--> | |
<!-- Exclude the Composer Vendor directory. --> | |
<exclude-pattern>/vendor/*</exclude-pattern> | |
<!-- Exclude the Node Modules directory. --> | |
<exclude-pattern>/node_modules/*</exclude-pattern> | |
<!-- Exclude all Javascript files. --> | |
<exclude-pattern>*.js</exclude-pattern> | |
<!-- Exclude minified CSS file. --> | |
<exclude-pattern>style.css</exclude-pattern> | |
<!-- Include the WordPress-Extra standard. --> | |
<rule ref="WordPress-Extra"> | |
<!-- | |
Example of removing a rule. | |
<exclude name="WordPress.WhiteSpace.ControlStructureSpacing"/> | |
--> | |
</rule> | |
<!-- Add in some extra rules from other standards. --> | |
<rule ref="Generic.CodeAnalysis.UnusedFunctionParameter"/> | |
<rule ref="Generic.Commenting.Todo"/> | |
<rule ref="Squiz.Commenting.FunctionComment.SpacingAfter"/> | |
<!-- Only enforce aligning assignment operators when difference is 2 or less. --> | |
<rule ref="Generic.Formatting.MultipleStatementAlignment"> | |
<properties> | |
<property name="maxPadding" value="2" /> | |
</properties> | |
</rule> | |
<!-- Do not follow WordPress class name naming requirements --> | |
<rule ref="WordPress.Files.FileName"> | |
<properties> | |
<property name="strict_class_file_names" value="false" /> | |
</properties> | |
</rule> | |
<rule ref="WordPress.NamingConventions.PrefixAllGlobals"> | |
<properties> | |
<property name="prefixes" type="array" value="fe_"/> | |
</properties> | |
</rule> | |
</ruleset> |
Leave a Reply