-
Notifications
You must be signed in to change notification settings - Fork 14
/
phpcs.xml
96 lines (80 loc) · 3.73 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<?xml version="1.0"?>
<ruleset name="custom">
<description>Custom PHPCS Standard, based on Drupal standards.</description>
<!--
CivicTheme base theme (web/themes/contrib/civictheme) scanning is not
included in this file. See web/themes/contrib/civictheme/phpcs.xml for
the basetheme's configuration.
-->
<file>web/modules/custom</file>
<file>web/themes/custom</file>
<file>web/sites/default/settings.php</file>
<file>web/sites/default/includes</file>
<file>tests</file>
<rule ref="Drupal"/>
<rule ref="DrupalPractice"/>
<rule ref="Generic.Debug.ESLint"/>
<rule ref="PHPCompatibility"/>
<arg name="extensions" value="inc,info,install,module,php,profile,test,theme,js,css"/>
<arg name="colors"/>
<arg value="sp"/>
<arg name="parallel" value="75"/>
<!-- Lint code against platform version specified in composer.json key "config.platform.php". -->
<config name="testVersion" value="8.3"/>
<!-- Exclude CircleCI config files. -->
<exclude-pattern>circle\.yml</exclude-pattern>
<exclude-pattern>\.circle\/config\.yml</exclude-pattern>
<!-- Exclude dependencies directories. -->
<exclude-pattern>node_modules/*</exclude-pattern>
<exclude-pattern>vendor/*</exclude-pattern>
<!-- Exclude FE assets. -->
<exclude-pattern>*\.css</exclude-pattern>
<exclude-pattern>*\.min\.js</exclude-pattern>
<exclude-pattern>*\/dist\/*\.js</exclude-pattern>
<exclude-pattern>\.storybook/*</exclude-pattern>
<exclude-pattern>storybook-static/*</exclude-pattern>
<exclude-pattern>webpack/*</exclude-pattern>
<!-- Exclude array-heavy files without any logic. -->
<exclude-pattern>web\/modules\/custom\/cs_generated_content\/generated_content\/node\/civictheme_page_variations\/.*</exclude-pattern>
<!-- Force no empty lines after function opening brace. -->
<rule ref="Squiz.WhiteSpace.FunctionOpeningBraceSpace">
<type>warning</type>
</rule>
<!-- Force no empty lines before control structure closing. -->
<rule ref="Squiz.WhiteSpace.ControlStructureSpacing.SpacingBeforeClose">
<type>warning</type>
</rule>
<!-- Force no empty lines after control structure closing. -->
<rule ref="Squiz.WhiteSpace.ControlStructureSpacing.LineAfterClose">
<type>warning</type>
</rule>
<!-- Allow incorrectly sorted namespaces in tests. -->
<rule ref="SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses.IncorrectlyOrderedUses">
<exclude-pattern>*.Test\.php</exclude-pattern>
<exclude-pattern>*.TestCase\.php</exclude-pattern>
<exclude-pattern>*.TestBase\.php</exclude-pattern>
<exclude-pattern>*.test</exclude-pattern>
</rule>
<!-- Allow long array lines in tests. -->
<rule ref="Drupal.Arrays.Array.LongLineDeclaration">
<exclude-pattern>*.Test\.php</exclude-pattern>
<exclude-pattern>*.TestCase\.php</exclude-pattern>
<exclude-pattern>*.TestBase\.php</exclude-pattern>
<exclude-pattern>*.test</exclude-pattern>
</rule>
<!-- Ignore Prefixing class names with project name in module behat tests. -->
<rule ref="DrupalPractice.General.ClassName.ClassPrefix">
<exclude-pattern>*\/tests\/behat\/bootstrap/*\.php</exclude-pattern>
</rule>
<!-- Disable constants check in JS. -->
<!-- @see https://www.drupal.org/project/coder/issues/3309040 -->
<rule ref="Generic.PHP.UpperCaseConstant.Found">
<exclude-pattern>\.js</exclude-pattern>
</rule>
<!-- Force declare(strict_types=1); in all PHP files. -->
<rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes">
<properties>
<property name="spacesCountAroundEqualsSign" value="0"/>
</properties>
</rule>
</ruleset>