Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
wpscholar committed Nov 21, 2018
0 parents commit 284d3a5
Show file tree
Hide file tree
Showing 2 changed files with 93 additions and 0 deletions.
76 changes: 76 additions & 0 deletions WPScholar/ruleset.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<?xml version="1.0"?>
<ruleset name="WPScholar">
<description>The WP Scholar PHP Code Sniffer standard.</description>

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

<exclude-pattern>*/phpunit.xml*</exclude-pattern>
<exclude-pattern>*/languages/*</exclude-pattern>
<exclude-pattern>*/tests/*</exclude-pattern>

<!-- Third-party code -->
<exclude-pattern>*/bower-components/*</exclude-pattern>
<exclude-pattern>*/node_modules/*</exclude-pattern>
<exclude-pattern>*/vendor/*</exclude-pattern>

<!-- Ensure certain file types aren't sniffed -->
<exclude-pattern>*.js</exclude-pattern>
<exclude-pattern>*.css</exclude-pattern>

<!-- Don't worry about files that don't contain any code -->
<rule ref="Internal.NoCodeFound">
<severity>0</severity>
</rule>

<!-- Ignore mixed line-endings warnings -->
<rule ref="Internal.LineEndings.Mixed">
<severity>0</severity>
</rule>

<!-- Internal exceptions (often occur on minified files) -->
<rule ref="Internal.Tokenizer.Exception">
<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 -->
<exclude name="Generic.Commenting.DocComment.LongNotCapital"/>
</rule>

<rule ref="WordPress-Extra">
<!-- Forget about file names -->
<exclude name="WordPress.Files.FileName"/>

<!-- Allow same line control structures e.g. if ( true ) { echo 1; } -->
<exclude name="Squiz.ControlStructures.ControlSignature.NewlineAfterOpenBrace"/>

<!-- Don't require punctuation after inline comments -->
<exclude name="Squiz.Commenting.InlineComment.InvalidEndChar"/>

<!-- Allow empty catch statements -->
<exclude name="Generic.CodeAnalysis.EmptyStatement.DetectedCatch"/>

<!-- 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"/>

<!-- Make missing translator comment a warning. -->
<rule ref="WordPress.WP.I18n.MissingTranslatorsComment">
<type>warning</type>
</rule>

<!-- Sometimes we need to override globals -->
<rule ref="WordPress.WP.GlobalVariablesOverride.OverrideProhibited">
<type>warning</type>
</rule>

<!-- Loads the PHP Compatibility ruleset. -->
<rule ref="PHPCompatibility"/>
</ruleset>
17 changes: 17 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "wpscholar/phpcs-standards-wpscholar",
"type": "phpcs-standards",
"license": "GPL-2.0-or-later",
"authors": [
{
"name": "Micah Wood",
"email": "micah@wpscholar.com"
}
],
"require": {
"squizlabs/php_codesniffer": "@stable",
"wimg/php-compatibility": "@stable",
"wp-coding-standards/wpcs": "@stable",
"wpscholar/phpcs-standards-installer": "@stable"
}
}

0 comments on commit 284d3a5

Please sign in to comment.