Skip to content

Commit

Permalink
Make standards easier to install. Set smarter defaults and ignore a f…
Browse files Browse the repository at this point in the history
…ew things that aren't important when not working on core.
  • Loading branch information
wpscholar committed Apr 30, 2019
1 parent a4596cf commit fbbd2ff
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 12 deletions.
34 changes: 24 additions & 10 deletions WPScholar/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@
<ruleset name="WPScholar">
<description>The WP Scholar PHP Code Sniffer standard.</description>

<config name="installed_paths" value="../../phpcompatibility/php-compatibility,../../wp-coding-standards/wpcs"/>
<arg name="colors"/>

<config name="testVersion" value="5.6-"/>

<!-- Sets the minimum supported WP version to 4.7, which is over a year old. -->
<config name="minimum_supported_wp_version" value="4.7"/>

<!-- For CI, don't fail on warnings -->
<config name="ignore_warnings_on_exit" value="1"/>

<exclude-pattern>*/phpunit.xml*</exclude-pattern>
<exclude-pattern>*/languages/*</exclude-pattern>
Expand Down Expand Up @@ -32,12 +40,11 @@
<severity>0</severity>
</rule>

<!-- For CI, don't fail on warnings -->
<config name="ignore_warnings_on_exit" value="1"/>

<!-- Enforce doc standards -->
<rule ref="WordPress-Docs">
<!-- Don't worry about capitolizing long lines -->
<!-- Don't worry about page comment blocks -->
<exclude name="Squiz.Commenting.FileComment.Missing"/>

<!-- Don't worry about capitalizing long lines -->
<exclude name="Generic.Commenting.DocComment.LongNotCapital"/>
</rule>

Expand All @@ -56,10 +63,16 @@

<!-- Comment punctuation doesn't matter -->
<exclude name="Squiz.Commenting.FunctionComment.ParamCommentFullStop"/>
</rule>

<!-- Sets the minimum supported WP version to 4.7, which is over a year old. -->
<config name="minimum_supported_wp_version" value="4.7"/>
<!-- Allow usage of short echo tag, but not short open tags -->
<exclude name="Generic.PHP.DisallowShortOpenTag.EchoFound"/>

<!-- Allow snake case -->
<exclude name="WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid"/>
<exclude name="WordPress.NamingConventions.ValidVariableName.PropertyNotSnakeCase"/>
<exclude name="WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase"/>
<exclude name="WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase"/>
</rule>

<!-- Make missing translator comment a warning. -->
<rule ref="WordPress.WP.I18n.MissingTranslatorsComment">
Expand All @@ -72,5 +85,6 @@
</rule>

<!-- Loads the PHP Compatibility ruleset. -->
<rule ref="PHPCompatibility"/>
<rule ref="PHPCompatibilityWP"/>

</ruleset>
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "wpscholar/phpcs-standards-wpscholar",
"description": "PHP Code Sniffer Standards for WP Scholar",
"type": "phpcs-standards",
"type": "phpcodesniffer-standard",
"license": "GPL-2.0-or-later",
"authors": [
{
Expand All @@ -13,6 +13,7 @@
"squizlabs/php_codesniffer": "@stable",
"phpcompatibility/php-compatibility": "@stable",
"wp-coding-standards/wpcs": "@stable",
"wpscholar/phpcs-standards-installer": "@stable"
"dealerdirect/phpcodesniffer-composer-installer": "@stable",
"phpcompatibility/phpcompatibility-wp": "@stable"
}
}

0 comments on commit fbbd2ff

Please sign in to comment.