Skip to content

Commit 5e408e5

Browse files
committed
initial version
1 parent 73160b7 commit 5e408e5

File tree

5 files changed

+83
-1
lines changed

5 files changed

+83
-1
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.idea

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
# phpcs-ruleset
1+
# Themeisle ruleset
2+
23
Global phpcs ruleset

Themeisle/phpcs.xml

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?xml version="1.0"?>
2+
<ruleset name="Themeisle">
3+
<description>Themeisle rules for PHP_CodeSniffer</description>
4+
5+
6+
<rule ref="WordPress-VIP-Go">
7+
<exclude name="WordPress.Security.NonceVerification.Recommended"/>
8+
<exclude name="WordPress.WP.TimezoneChange.DeprecatedSniff"/>
9+
<exclude name="WordPressVIPMinimum.Security.Mustache.OutputNotation"/>
10+
</rule>
11+
<rule ref="WordPress-Core">
12+
13+
<exclude name="Squiz.Commenting.FileComment.SpacingAfterComment"/>
14+
<exclude name="Generic.Arrays.DisallowShortArraySyntax.Found"/>
15+
<exclude name="Squiz.Commenting.FunctionComment.MissingParamTag"/>
16+
<exclude name="Squiz.Commenting.InlineComment.InvalidEndChar"/>
17+
<exclude name="Squiz.Commenting.InlineComment.NotCapital"/>
18+
<exclude name="WordPress.PHP.YodaConditions.NotYoda"/>
19+
<exclude name="WordPress.Files.FileName.InvalidClassFileName"/>
20+
<exclude name="Squiz.PHP.CommentedOutCode.Found"/>
21+
<exclude name="WordPress.Files.FileName.NotHyphenatedLowercase"/>
22+
</rule>
23+
24+
<rule ref="WordPress-Docs" />
25+
<rule ref="WordPress-Extra">
26+
<exclude name="PSR2.Classes.PropertyDeclaration.Underscore"/>
27+
</rule>
28+
<rule ref="PHPCompatibilityWP"/>
29+
30+
31+
<rule ref="Squiz.Commenting.FunctionComment.ScalarTypeHintMissing">
32+
<severity>0</severity>
33+
</rule>
34+
<rule ref="WordPress.Security.EscapeOutput">
35+
<properties>
36+
<property name="customAutoEscapedFunctions" type="array">
37+
<element value="$_"/>
38+
</property>
39+
</properties>
40+
</rule>
41+
42+
43+
</ruleset>

bin/phpcbf-fix-exit-0

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env php
2+
<?php
3+
/**
4+
* Fix incompatibility with lint-staged for exit codes.
5+
*
6+
*/
7+
8+
if (is_file(__DIR__.'/../../../squizlabs/php_codesniffer/autoload.php') === true) {
9+
include_once __DIR__.'/../../../squizlabs/php_codesniffer/autoload.php';
10+
} else {
11+
include_once 'PHP/CodeSniffer/autoload.php';
12+
}
13+
14+
$runner = new PHP_CodeSniffer\Runner();
15+
$exitCode = $runner->runPHPCBF();
16+
17+
if ( 1 === $exitCode ){
18+
$exitCode = 0;
19+
}
20+
exit($exitCode);

composer.json

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"name": "codeinwp/phpcs-ruleset",
3+
"description": "PHPCS coding standards for Themeisle products.",
4+
"type": "phpcodesniffer-standard",
5+
"bin": [
6+
"bin/phpcbf-fix-exit-0"
7+
],
8+
"require": {
9+
"wptrt/wpthemereview": "*",
10+
"automattic/vipwpcs": "^2.0",
11+
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.0",
12+
"sirbrillig/phpcs-variable-analysis": "^2.10"
13+
},
14+
"scripts": {
15+
"post-install-cmd": "\"vendor/bin/phpcs\" --config-set default_standard Themeisle"
16+
}
17+
}

0 commit comments

Comments
 (0)