forked from ec-europa/joinup-dev
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathphpcs-ruleset.xml.dist
84 lines (70 loc) · 3.48 KB
/
phpcs-ruleset.xml.dist
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<?xml version="1.0"?>
<!-- PHP_CodeSniffer standard for Joinup. -->
<!-- See http://pear.php.net/manual/en/package.php.php-codesniffer.annotated-ruleset.php -->
<ruleset name="Joinup">
<description>Joinup coding standard</description>
<!-- Include the Slevomat sniffs. -->
<config name="installed_paths" value="../../slevomat/coding-standard"/>
<!-- Exclude unsupported file types. -->
<exclude-pattern>*.gif</exclude-pattern>
<exclude-pattern>*.less</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>
<!-- Exclude frontend third-party libraries from coding standards -->
<exclude-pattern>web/themes/joinup/vendor/*</exclude-pattern>
<exclude-pattern>web/themes/joinup/node_modules/*</exclude-pattern>
<rule ref="./vendor/drupal/coder/coder_sniffer/Drupal" />
<rule ref="./vendor/drupal/coder/coder_sniffer/DrupalPractice">
<exclude name="DrupalPractice.CodeAnalysis.VariableAnalysis.UndefinedVariable" />
<exclude name="DrupalPractice.Yaml" />
</rule>
<!-- Do not report lines exceeding 80 characters for Markdown files that contain long file paths. -->
<rule ref="Drupal.Files.TxtFileLineLength.TooLong">
<exclude-pattern>web/modules/custom/joinup_subscription/README.md</exclude-pattern>
</rule>
<!-- Validate the (post)update identifiers. -->
<rule ref="./src/CodingStandards"/>
<!-- Require the strict types declaration in every PHP file. -->
<rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes">
<properties>
<property name="newlinesCountBetweenOpenTagAndDeclare" value="2"/>
</properties>
</rule>
<!-- Require the strict types declaration in every PHP file. -->
<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">
<properties>
<property name="caseSensitive" value="true"/>
</properties>
</rule>
</ruleset>