Add phpcs.xml.dist

Fixes #124
This commit is contained in:
Oliver Davies 2020-06-30 17:31:36 +01:00
parent 9e3064ca21
commit ae50869065
2 changed files with 58 additions and 0 deletions

1
.gitignore vendored
View file

@ -7,6 +7,7 @@
!/bin/*
!/config/**
!/Makefile
!/phpcs.xml.dist
!/phpstan.neon
!/phpunit.xml.dist
!/scripts/**

57
phpcs.xml.dist Normal file
View file

@ -0,0 +1,57 @@
<?xml version="1.0"?>
<ruleset name="Custom code">
<description>Drupal Coding Standards</description>
<file>./web/modules/custom</file>
<file>./web/themes/custom</file>
<arg name="extensions" value="inc,install,module,php,profile,test,theme,yml"/>
<!-- Exclude third party code.-->
<exclude-pattern>./web/sites/*</exclude-pattern>
<exclude-pattern>./web/themes/custom/*\.(?!theme$)</exclude-pattern>
<arg name="colors" />
<arg value="np"/>
<!-- Use Drupal rules -->
<rule ref="Drupal"/>
<rule ref="DrupalPractice"/>
<rule ref="Drupal.Commenting.ClassComment.Missing">
<severity>0</severity>
</rule>
<rule ref="Drupal.Commenting.ClassComment.Missing">
<severity>0</severity>
</rule>
<rule ref="Drupal.Commenting.FunctionComment.Missing">
<severity>0</severity>
</rule>
<rule ref="Drupal.Commenting.DocComment.MissingShort">
<severity>0</severity>
</rule>
<rule ref="Drupal.Commenting.FunctionComment.MissingParamComment">
<severity>0</severity>
</rule>
<rule ref="Drupal.Commenting.FunctionComment.MissingReturnComment">
<severity>0</severity>
</rule>
<rule ref="Drupal.Commenting.VariableComment.Missing">
<severity>0</severity>
</rule>
<rule ref="Drupal.Commenting.DataTypeNamespace.DataTypeNamespace">
<severity>0</severity>
</rule>
<!-- -->
<rule ref="Drupal.Commenting.DocComment.ContentAfterOpen">
<severity>1</severity>
</rule>
<rule ref="Drupal.NamingConventions.ValidFunctionName.ScopeNotCamelCaps">
<severity>1</severity>
</rule>
<!-- Features module doesn't export config schema -->
<rule ref="DrupalPractice.Objects.StrictSchemaDisabled.StrictConfigSchema">
<severity>0</severity>
</rule>
</ruleset>