Skip to content

Commit 3167989

Browse files
committed
Add coding standards and configuration
1 parent 6e9e258 commit 3167989

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

composer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,8 @@
4848
},
4949
"autoload": {
5050
"psr-4": {"DeliciousBrains\\SpinupWPComposerSite\\": "app/"}
51+
},
52+
"require-dev": {
53+
"humanmade/coding-standards": "^1.1"
5154
}
5255
}

phpcs.xml.dist

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?xml version="1.0"?>
2+
<ruleset name="Delicious Brains">
3+
<!-- Files or directories to check -->
4+
<file>.</file>
5+
6+
<!-- Exclude the keys file as this is auto-generated from the WordPress generator -->
7+
<exclude-pattern type="relative-root">^/config/keys.php</exclude-pattern>
8+
9+
<!-- Path to strip from the front of file paths inside reports (displays shorter paths) -->
10+
<arg name="basepath" value="." />
11+
12+
<!-- Use HM Coding Standards -->
13+
<rule ref="vendor/humanmade/coding-standards">
14+
<!-- Namespace isn't required for all files. -->
15+
<exclude name="HM.Functions.NamespacedFunctions.MissingNamespace" />
16+
<!-- Ignore rule expecting Namespaced directory. -->
17+
<exclude name="HM.Files.NamespaceDirectoryName.NoIncDirectory" />
18+
<!-- File name and class name match is not necessary. -->
19+
<exclude name="HM.Files.ClassFileName.MismatchedName" />
20+
<!-- Ignore class file name rule -->
21+
<exclude name="WordPress.Files.FileName.InvalidClassFileName" />
22+
<!-- Ignore rule expecting hyphens in file name. -->
23+
<exclude name="WordPress.Files.FileName.NotHyphenatedLowercase" />
24+
<!-- Don't require file comment header. -->
25+
<exclude name="Squiz.Commenting.FileComment.Missing" />
26+
</rule>
27+
28+
<!-- Ignore Snake case variables for tests -->
29+
<rule ref="WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase">
30+
<exclude-pattern>/tests/*</exclude-pattern>
31+
</rule>
32+
</ruleset>

0 commit comments

Comments
 (0)