Skip to content

Commit 884ede0

Browse files
authored
feat(TraitNameSuffix): Enable sniff (#3557537)
1 parent 822df19 commit 884ede0

File tree

4 files changed

+14
-1
lines changed

4 files changed

+14
-1
lines changed

.github/workflows/testing.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,4 +100,4 @@ jobs:
100100
sed -i 's/Drupal.Methods.MethodDeclaration/PSR2.Methods.MethodDeclaration/g' phpcs.xml.dist
101101
sed -i '/<rule ref="Drupal.WhiteSpace.Namespace"\/>/d' phpcs.xml.dist
102102
sed -i 's/Drupal.Classes.InterfaceName/Generic.NamingConventions.InterfaceNameSuffix/g' phpcs.xml.dist
103-
../../vendor/bin/phpcs -p -s --parallel=$(nproc) --ignore=lib/Drupal/Core/Command/GenerateTheme.php,modules/mysql/tests/src/Kernel/mysql/Console/DbDumpCommandTest.php,modules/big_pipe/tests/modules/big_pipe_test/src/BigPipePlaceholderTestCases.php,tests/fixtures/plugins/CustomPlugin.php,modules/package_manager/tests/modules/package_manager_test_api/src/ApiController.php
103+
../../vendor/bin/phpcs -p -s --parallel=$(nproc) --ignore=lib/Drupal/Core/Command/GenerateTheme.php,modules/mysql/tests/src/Kernel/mysql/Console/DbDumpCommandTest.php,modules/big_pipe/tests/modules/big_pipe_test/src/BigPipePlaceholderTestCases.php,tests/fixtures/plugins/CustomPlugin.php,modules/package_manager/tests/modules/package_manager_test_api/src/ApiController.php,modules/views/tests/src/Kernel/Plugin/StyleGridTest.php

coder_sniffer/Drupal/ruleset.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
</rule>
5353
<rule ref="Generic.NamingConventions.ConstructorName"/>
5454
<rule ref="Generic.NamingConventions.InterfaceNameSuffix"/>
55+
<rule ref="Generic.NamingConventions.TraitNameSuffix"/>
5556
<rule ref="Generic.NamingConventions.UpperCaseConstantName"/>
5657
<rule ref="Generic.PHP.DeprecatedFunctions"/>
5758
<rule ref="Generic.PHP.DisallowShortOpenTag">

tests/Drupal/bad/BadUnitTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,10 @@ protected function getErrorList(string $testFile): array
388388
1 => 1,
389389
3 => 1,
390390
];
391+
case 'TraitNameSuffix.inc':
392+
return [
393+
6 => 1,
394+
];
391395
case 'UnusedUseStatementUnitTest.inc':
392396
return [
393397
5 => 1,
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?php
2+
3+
/**
4+
* Trait name must end with 'Trait'.
5+
*/
6+
trait TraitNameSuffix {
7+
8+
}

0 commit comments

Comments
 (0)