-
Notifications
You must be signed in to change notification settings - Fork 42
/
Copy pathphpcs-ruleset.xml
146 lines (123 loc) · 9.82 KB
/
phpcs-ruleset.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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<?xml version="1.0"?>
<!-- PHP_CodeSniffer standard for NextEuropa. -->
<!-- See http://pear.php.net/manual/en/package.php.php-codesniffer.annotated-ruleset.php -->
<ruleset name="NextEuropa">
<description>Drupal coding standard for NextEuropa</description>
<!-- Plan with exceptions for modules that need to be fixed gradually -->
<!-- https://webgate.ec.europa.eu/CITnet/jira/browse/NEPT-804 -->
<rule ref="./phpcs-qa-roadmap.xml"/>
<!-- 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-pattern>build/vendor/</exclude-pattern>
<exclude-pattern>profiles/common/themes/</exclude-pattern>
<exclude-pattern>profiles/multisite_drupal_*/themes/</exclude-pattern>
<rule ref="./vendor/drupal/coder/coder_sniffer/Drupal" />
<!-- Exclude third party code. -->
<exclude-pattern>profiles/common/libraries/</exclude-pattern>
<exclude-pattern>profiles/multisite_drupal_*/libraries/</exclude-pattern>
<exclude-pattern>profiles/multisite_drupal_*/modules/contrib/</exclude-pattern>
<exclude-pattern>profiles/common/modules/custom/ecas/libraries/</exclude-pattern>
<exclude-pattern>profiles/common/modules/custom/tmgmt_poetry/tests/</exclude-pattern>
<exclude-pattern>profiles/common/modules/features/multisite_wysiwyg/ckeditor/skins</exclude-pattern>
<exclude-pattern>profiles/common/modules/custom/multisite_drupal_toolbox/icons</exclude-pattern>
<!-- https://webgate.ec.europa.eu/CITnet/jira/browse/NEPT-2604 -->
<exclude-pattern>profiles/*/modules/custom/nexteuropa_varnish/</exclude-pattern>
<!-- This module is not supported by Core team so we exclude it from QA -->
<exclude-pattern>profiles/*/modules/custom/nexteuropa_newsroom/</exclude-pattern>
<!-- Views handlers/plugins not strictly follow Drupal class name conventions. -->
<rule ref="Drupal.NamingConventions.ValidClassName">
<exclude-pattern>profiles/common/modules/custom/ecas/ecas_extra/includes/views/handlers/*.inc</exclude-pattern>
<exclude-pattern>profiles/*/modules/**/views/*.inc</exclude-pattern>
</rule>
<!-- Code based on the classes from Web Service Clients or TMGMT do not follow Drupal function name conventions. -->
<rule ref="Drupal.NamingConventions.ValidFunctionName.ScopeNotCamelCaps">
<exclude-pattern>profiles/common/modules/custom/tmgmt_workbench/includes/tmgmt_workbench.ui.inc</exclude-pattern>
</rule>
<!-- Callbacks for the SoapServer class (part of the Soap extension) do not follow Drupal function name conventions. -->
<rule ref="Drupal.NamingConventions.ValidFunctionName.InvalidName">
<exclude-pattern>profiles/common/modules/custom/nexteuropa_dgt_connector/tmgmt_poetry/tmgmt_poetry.module</exclude-pattern>
<exclude-pattern>profiles/common/modules/custom/nexteuropa_dgt_connector/tmgmt_poetry/inc/tmgmt_poetry.webservice.inc</exclude-pattern>
</rule>
<!-- Tmgmt poetry tests not strictly follow Drupal class name conventions. -->
<rule ref="Drupal.NamingConventions.ValidClassName">
<exclude-pattern>profiles/common/modules/custom/nexteuropa_dgt_connector/tmgmt_poetry/tests/tmgmt_poetry.test</exclude-pattern>
</rule>
<!-- Custom TMGMT DGT modules should be included in the feature folder. -->
<rule ref="QualityAssurance.InfoFiles.Features.CustomModule">
<exclude-pattern>profiles/common/modules/custom/nexteuropa_dgt_connector/**</exclude-pattern>
<exclude-pattern>profiles/multisite_drupal_standard/modules/custom/nexteuropa_dgt_connector/**</exclude-pattern>
<exclude-pattern>profiles/multisite_drupal_communities/modules/custom/nexteuropa_dgt_connector/**</exclude-pattern>
</rule>
<!-- Next Europa PiwikRuleEntityUIController do not follow Drupal function name conventions. -->
<rule ref="Drupal.NamingConventions.ValidFunctionName.ScopeNotCamelCaps">
<exclude-pattern>profiles/common/modules/custom/nexteuropa_piwik/src/EntityDefaultUIController/PiwikRuleEntityUIController.php</exclude-pattern>
</rule>
<!-- Phing tasks require to use CamelCaps for argument names. -->
<rule ref="Drupal.NamingConventions.ValidVariableName">
<exclude-pattern>src/Phing</exclude-pattern>
</rule>
<!-- Comments in exported fields are missing a period at the end. -->
<!-- Todo: Remove this when https://www.drupal.org/node/2568161 is fixed. -->
<rule ref="Drupal.Commenting.InlineComment.InvalidEndChar">
<exclude-pattern>profiles/*/modules/features/**/*features.field_base.inc</exclude-pattern>
<exclude-pattern>profiles/*/modules/features/**/*features.field_instance.inc</exclude-pattern>
</rule>
<!-- NEPT-1288: Views files are to be excluded from class name checking. -->
<rule ref="DrupalPractice.General.ClassName.ClassPrefix">
<exclude-pattern>*/views_handler*</exclude-pattern>
<exclude-pattern>*/views_handler*</exclude-pattern>
</rule>
<!-- Views handlers function names don't follow camelcase. -->
<rule ref="Drupal.NamingConventions.ValidFunctionName.ScopeNotCamelCaps">
<exclude-pattern>*/views_handler*</exclude-pattern>
<exclude-pattern>*/views_handler*</exclude-pattern>
<exclude-pattern>profiles/common/modules/custom/nexteuropa_dgt_connector/tmgmt_dgt_connector/tmgmt_dgt_connector_cart/src/ViewsHandler/*</exclude-pattern>
<exclude-pattern>profiles/common/modules/features/multisite_twitterblock/plugins/multisite_twitterblock_reaction.inc</exclude-pattern>
<exclude-pattern>profiles/common/modules/custom/tmgmt_workbench/includes/tmgmt_workbench.ui.inc</exclude-pattern>
<exclude-pattern>profiles/common/modules/custom/nexteuropa_piwik/src/EntityDefaultUIController/PiwikRuleEntityUIController.php</exclude-pattern>
<exclude-pattern>profiles/common/modules/custom/nexteuropa_dgt_connector/tmgmt_dgt_connector/tmgmt_dgt_connector_cart/src/EntityUIController/*</exclude-pattern>
<exclude-pattern>profiles/common/modules/custom/nexteuropa_dgt_connector/tmgmt_dgt_connector/tmgmt_dgt_connector_cart/src/EntityViewsController/*</exclude-pattern>
</rule>
<!-- Current QA rules give false positives for submodules of a feature. -->
<!-- Todo: Remove this when MULTISITE-18366 is fixed. -->
<rule ref="QualityAssurance.InfoFiles.Features.CustomModule">
<exclude-pattern>*</exclude-pattern>
</rule>
<!-- NEPT-1373: Skip checks for Type hint "array" missing in legacy code. -->
<rule ref="Drupal.Commenting.FunctionComment.TypeHintMissing">
<exclude-pattern>profiles/common/modules/custom/ecas/includes/ecas.inc</exclude-pattern>
<exclude-pattern>profiles/common/modules/custom/multisite_config/lib/Drupal/filter/Config.php</exclude-pattern>
<exclude-pattern>profiles/common/modules/custom/multisite_config/lib/Drupal/taxonomy/Config.php</exclude-pattern>
<exclude-pattern>profiles/common/modules/custom/multisite_config/lib/Drupal/wysiwyg/Config.php</exclude-pattern>
<exclude-pattern>profiles/common/modules/custom/multisite_drupal_toolbox/multisite_drupal_toolbox.module</exclude-pattern>
<exclude-pattern>profiles/common/modules/custom/nexteuropa_piwik/nexteuropa_piwik.module</exclude-pattern>
<exclude-pattern>profiles/common/modules/custom/nexteuropa_token/src/Entity/TokenAbstractHandler.php</exclude-pattern>
<exclude-pattern>profiles/common/modules/custom/tmgmt_workbench/includes/tmgmt_workbench.ui.inc</exclude-pattern>
<exclude-pattern>profiles/common/modules/features/cce_basic_config/cce_basic_config.helpers.inc</exclude-pattern>
<exclude-pattern>profiles/common/modules/custom/nexteuropa_dgt_connector/tmgmt_dgt_html/tmgmt_dgt_html.module</exclude-pattern>
<exclude-pattern>profiles/common/modules/custom/nexteuropa_dgt_connector/tmgmt_poetry/entity/tmgmt_poetry.entity.job.inc</exclude-pattern>
<exclude-pattern>profiles/common/modules/custom/nexteuropa_dgt_connector/tmgmt_poetry/plugins/tmgmt_poetry.plugin.inc</exclude-pattern>
<exclude-pattern>profiles/common/modules/custom/nexteuropa_dgt_connector/tmgmt_poetry/tmgmt_poetry.module</exclude-pattern>
<exclude-pattern>profiles/common/modules/custom/nexteuropa_dgt_connector/tmgmt_poetry/tmgmt_poetry_mock/includes/tmgmt_poetry_mock_dashboard.inc</exclude-pattern>
<exclude-pattern>profiles/common/modules/custom/nexteuropa_dgt_connector/tmgmt_poetry/tmgmt_poetry_mock/src/Mock/PoetryMock.php</exclude-pattern>
<exclude-pattern>profiles/common/modules/custom/nexteuropa_dgt_connector/tmgmt_poetry/views/handlers/tmgmt_poetry_handler_field_progress.inc</exclude-pattern>
<exclude-pattern>profiles/common/modules/features/nexteuropa_geofield/nexteuropa_geofield.module</exclude-pattern>
<exclude-pattern>profiles/common/modules/features/nexteuropa_multilingual/nexteuropa_multilingual.module</exclude-pattern>
<exclude-pattern>profiles/common/modules/features/nexteuropa_trackedchanges/nexteuropa_trackedchanges.admin.inc</exclude-pattern>
<exclude-pattern>profiles/common/modules/features/nexteuropa_trackedchanges/nexteuropa_trackedchanges.helper.inc</exclude-pattern>
</rule>
<!-- Exclude readme, license and changelog files from checking line length. -->
<rule ref="Drupal.Files.TxtFileLineLength.TooLong">
<exclude-pattern>*/README.md</exclude-pattern>
<exclude-pattern>*/README.txt</exclude-pattern>
<exclude-pattern>*/LICENSE.md</exclude-pattern>
<exclude-pattern>*/LICENSE.txt</exclude-pattern>
<exclude-pattern>*/CHANGELOG.md</exclude-pattern>
<exclude-pattern>*/CHANGELOG.txt</exclude-pattern>
</rule>
</ruleset>