-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathphpcs.xml
69 lines (56 loc) · 2.86 KB
/
phpcs.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="droopler">
<description>PHP CodeSniffer configuration for a Drupal module.</description>
<arg name="extensions" value="php,inc,install,module,info,test,profile,theme,yaml,txt,twig,scss"/>
<arg name="report" value="full,gitblame"/>
<config name="installed_paths" value="../../drupal/coder/coder_sniffer/Drupal,../../drupal/coder/coder_sniffer/DrupalPractice,../../slevomat/coding-standard" />
<file>/app/web/modules/custom</file>
<file>/app/web/themes/custom</file>
<!-- Exclude third party libraries. -->
<exclude-pattern>/.ddev</exclude-pattern>
<exclude-pattern>*/vendor/*</exclude-pattern>
<exclude-pattern>*/node_modules/*</exclude-pattern>
<exclude-pattern>*/themes/custom/*/build/*</exclude-pattern>
<!-- Exclude unsupported file types. -->
<exclude-pattern>*.gif</exclude-pattern>
<exclude-pattern>*.png</exclude-pattern>
<!-- Minified files don't have to comply with coding standards. -->
<exclude-pattern>*.min.css</exclude-pattern>
<exclude-pattern>*.min.js</exclude-pattern>
<rule ref="Drupal" />
<rule ref="DrupalPractice" />
<!-- Require the strict types declaration in every PHP file. -->
<rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes">
</rule>
<!-- Require nullable types to be declared as such. -->
<rule ref="SlevomatCodingStandard.TypeHints.NullableTypeForNullDefaultValue">
</rule>
<!-- Forbid annotations which are not included in the Drupal coding standard but are often added by IDEs. -->
<rule ref="SlevomatCodingStandard.Commenting.ForbiddenAnnotations">
<properties>
<property name="forbiddenAnnotations" type="array">
<element value="@author"/>
<element value="@created"/>
<element value="@copyright"/>
<element value="@license"/>
<element value="@package"/>
<element value="@version"/>
</property>
</properties>
</rule>
<!-- Forbid documentation auto-generated by IDEs which does not align with the Drupal documentation standards. -->
<rule ref="SlevomatCodingStandard.Commenting.ForbiddenComments">
<properties>
<property name="forbiddenCommentPatterns" type="array">
<element value="/@inheritDoc/"/>
<element value="/^Class [a-zA-z]*\.$/"/>
<element value="/^Interface [a-zA-z]*\.$/"/>
<element value="/^[a-zA-z]* constructor\.$/"/>
</property>
</properties>
</rule>
<!-- Enforce correct formatting of return types hints. -->
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHintSpacing"/>
<!-- Use statements should be ordered alphabetically. -->
<rule ref="SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses" />
</ruleset>