Skip to content

Commit

Permalink
Merge pull request #38 from christophherr/wpcs
Browse files Browse the repository at this point in the history
Updated composer dependencies and phpcs.xml.dist
  • Loading branch information
christophherr authored Jul 30, 2018
2 parents bf51d5a + 93f69a8 commit 1be2b4e
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 16 deletions.
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
"php": "^5.6|^7"
},
"require-dev": {
"squizlabs/php_codesniffer": "^3.2",
"wp-coding-standards/wpcs": "^0.14.1",
"wimg/php-compatibility": "^8.1",
"squizlabs/php_codesniffer": "^3.3",
"wp-coding-standards/wpcs": "^1.0",
"wimg/php-compatibility": "^8.2",
"dealerdirect/phpcodesniffer-composer-installer": "^0.4.4"
},
"scripts": {
Expand Down
39 changes: 26 additions & 13 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -6,49 +6,62 @@
<!-- See https://github.com/wimg/PHPCompatibility -->
<!-- See https://github.com/Automattic/_s/blob/master/phpcs.xml.dist -->
<description>Custom rules for Prometheus 2.</description>

<!-- Check files in this directory and subdirectories. -->
<file>.</file>

<!-- Prevent sniffs of some directories. -->
<exclude-pattern>/vendor/</exclude-pattern>
<exclude-pattern>/node_modules/</exclude-pattern>

<!-- Pass flags to PHPCS:
p: Show progress of the run.
s: Show sniff codes in all reports.
v: Print verbose output.
-->
<arg value="psv"/>
<arg name="colors"/>
<!-- Only check PHP files. -->
<arg name="extensions" value="php"/>
<!-- Set a basepath to remove user environment specific paths from the results. -->
<arg name="basepath" value="."/>
<!-- Enable parallel processing which will speed up the sniffs if available. -->
<arg name="parallel" value="32"/>

<!-- Test PHP cross-version compatibility. -->
<rule ref="PHPCompatibility"/>
<config name="testVersion" value="5.6-"/>
<config name="minimum_supported_wp_version" value="4.8"/>

<!-- Use the WordPress ruleset, with exclusions. -->
<rule ref="WordPress">
<exclude name="WordPress.VIP"/>
<exclude name="Squiz.PHP.CommentedOutCode.Found"/>
<exclude name="Squiz.PHP.CommentedOutCode.Found"/>
</rule>

<!-- Page templates currently use underscores for historic reasons. -->
<rule ref="WordPress.Files.FileName.NotHyphenatedLowercase">
<exclude-pattern>page_landing.php</exclude-pattern>
</rule>
<!-- Test PHP cross-version compatibility. -->
<config name="testVersion" value="5.6-"/>
<rule ref="PHPCompatibility"/>

<!-- Check for correct text domain on all translatable strings. -->
<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="array" value="prometheus2"/>
</properties>
</rule>
<!-- Verify that no WP functions are used which are deprecated or removed. -->
<rule ref="WordPress.WP.DeprecatedFunctions">
<properties>
<property name="minimum_supported_version" value="4.4"/>
<property name="text_domain" type="array">
<element value="prometheus2"/>
</property>
</properties>
</rule>

<!-- Check all globals have the expected prefix. -->
<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
<properties>
<property name="prefixes" type="array" value="CHILD_THEME, CHILD_TEXT_DOMAIN"/>
<property name="prefixes" type="array">
<element value="CHILD_THEME"/>
<element value="CHILD_TEXT_DOMAIN"/>
</property>
</properties>
</rule>

<!-- Allow theme-specific exceptions to WordPress filename rules. -->
<rule ref="WordPress.Files.FileName">
<properties>
Expand Down

0 comments on commit 1be2b4e

Please sign in to comment.