From 817b840da146c35fb18d05e80750bf44e7ac9127 Mon Sep 17 00:00:00 2001 From: Klaus Purer Date: Sun, 23 Nov 2025 09:12:22 +0100 Subject: [PATCH 1/2] feat(TraitNameSuffix): Enable sniff (#3557537) --- coder_sniffer/Drupal/ruleset.xml | 1 + tests/Drupal/bad/BadUnitTest.php | 4 ++++ tests/Drupal/bad/TraitNameSuffix.inc | 8 ++++++++ 3 files changed, 13 insertions(+) create mode 100644 tests/Drupal/bad/TraitNameSuffix.inc diff --git a/coder_sniffer/Drupal/ruleset.xml b/coder_sniffer/Drupal/ruleset.xml index 83dd4d3f..a65099ba 100644 --- a/coder_sniffer/Drupal/ruleset.xml +++ b/coder_sniffer/Drupal/ruleset.xml @@ -52,6 +52,7 @@ + diff --git a/tests/Drupal/bad/BadUnitTest.php b/tests/Drupal/bad/BadUnitTest.php index 227fdf42..d24dd3a3 100644 --- a/tests/Drupal/bad/BadUnitTest.php +++ b/tests/Drupal/bad/BadUnitTest.php @@ -388,6 +388,10 @@ protected function getErrorList(string $testFile): array 1 => 1, 3 => 1, ]; + case 'TraitNameSuffix.inc': + return [ + 6 => 1, + ]; case 'UnusedUseStatementUnitTest.inc': return [ 5 => 1, diff --git a/tests/Drupal/bad/TraitNameSuffix.inc b/tests/Drupal/bad/TraitNameSuffix.inc new file mode 100644 index 00000000..1346a468 --- /dev/null +++ b/tests/Drupal/bad/TraitNameSuffix.inc @@ -0,0 +1,8 @@ + Date: Sun, 23 Nov 2025 09:19:06 +0100 Subject: [PATCH 2/2] exclude broken core StyleGridTest.php --- .github/workflows/testing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 967bcc08..829763c7 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -100,4 +100,4 @@ jobs: sed -i 's/Drupal.Methods.MethodDeclaration/PSR2.Methods.MethodDeclaration/g' phpcs.xml.dist sed -i '//d' phpcs.xml.dist sed -i 's/Drupal.Classes.InterfaceName/Generic.NamingConventions.InterfaceNameSuffix/g' phpcs.xml.dist - ../../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 + ../../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