Skip to content

Commit

Permalink
Add coding standards and configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
rosswintle committed Nov 12, 2021
1 parent 6e9e258 commit 3167989
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,8 @@
},
"autoload": {
"psr-4": {"DeliciousBrains\\SpinupWPComposerSite\\": "app/"}
},
"require-dev": {
"humanmade/coding-standards": "^1.1"
}
}
32 changes: 32 additions & 0 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0"?>
<ruleset name="Delicious Brains">
<!-- Files or directories to check -->
<file>.</file>

<!-- Exclude the keys file as this is auto-generated from the WordPress generator -->
<exclude-pattern type="relative-root">^/config/keys.php</exclude-pattern>

<!-- Path to strip from the front of file paths inside reports (displays shorter paths) -->
<arg name="basepath" value="." />

<!-- Use HM Coding Standards -->
<rule ref="vendor/humanmade/coding-standards">
<!-- Namespace isn't required for all files. -->
<exclude name="HM.Functions.NamespacedFunctions.MissingNamespace" />
<!-- Ignore rule expecting Namespaced directory. -->
<exclude name="HM.Files.NamespaceDirectoryName.NoIncDirectory" />
<!-- File name and class name match is not necessary. -->
<exclude name="HM.Files.ClassFileName.MismatchedName" />
<!-- Ignore class file name rule -->
<exclude name="WordPress.Files.FileName.InvalidClassFileName" />
<!-- Ignore rule expecting hyphens in file name. -->
<exclude name="WordPress.Files.FileName.NotHyphenatedLowercase" />
<!-- Don't require file comment header. -->
<exclude name="Squiz.Commenting.FileComment.Missing" />
</rule>

<!-- Ignore Snake case variables for tests -->
<rule ref="WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase">
<exclude-pattern>/tests/*</exclude-pattern>
</rule>
</ruleset>

0 comments on commit 3167989

Please sign in to comment.