Skip to content

Commit 409623b

Browse files
committed
also ignore test base
1 parent 0549a46 commit 409623b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

.github/workflows/testing.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ jobs:
8686
sed -i 's/Drupal.Classes.ClassCreateInstance/SlevomatCodingStandard.ControlStructures.NewWithParentheses/g' phpcs.xml.dist
8787
sed -i 's/Drupal.Classes.UnusedUseStatement/SlevomatCodingStandard.Namespaces.UnusedUses/g' phpcs.xml.dist
8888
sed -i '/<rule ref="SlevomatCodingStandard.Exceptions.RequireNonCapturingCatch" \/>/a \ <rule ref="SlevomatCodingStandard.Namespaces.UseFromSameNamespace"/>' phpcs.xml.dist
89-
sed -i 's|<rule ref="Drupal.Classes.ClassFileName"/>|<rule ref="Squiz.Classes.ClassFileName">\n <!-- Disable class name to file name matching for *Test.php files. -->\n <exclude-pattern>*/tests/*/*Test.php</exclude-pattern>\n </rule>|' phpcs.xml.dist
89+
sed -i 's@<rule ref="Drupal.Classes.ClassFileName"/>@<rule ref="Squiz.Classes.ClassFileName">\n <!-- Disable class name to file name matching for *Test.php files. -->\n <exclude-pattern>*/tests/*/*(Test|TestBase).php</exclude-pattern>\n </rule>@' phpcs.xml.dist
9090
find . -type f -name "*.php" -exec sed -i 's#// phpcs:ignore Drupal.Classes.PropertyDeclaration, Drupal.NamingConventions.ValidVariableName.LowerCamelName, Drupal.Commenting.VariableComment.Missing#// phpcs:ignore Drupal.NamingConventions.ValidVariableName.LowerCamelName,PSR2.Classes.PropertyDeclaration.Underscore#g' {} +
9191
find . -type f -name "*.php" -exec sed -i 's#// @codingStandardsIgnoreLine#// phpcs:ignore#g' {} +
9292
find . -type f -name "*.php" -exec sed -i 's#// @codingStandardsIgnoreFile#// phpcs:ignoreFile#g' {} +
@@ -96,4 +96,4 @@ jobs:
9696
sed -i '/<rule ref="Drupal.Functions.FunctionDeclaration"\/>/d' phpcs.xml.dist
9797
sed -i 's/DrupalPractice.CodeAnalysis.VariableAnalysis/VariableAnalysis.CodeAnalysis.VariableAnalysis/g' phpcs.xml.dist
9898
find .. -type f -name "*.php" -exec sed -i 's#// phpcs:ignore DrupalPractice.CodeAnalysis.VariableAnalysis#// phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis#g' {} +
99-
../../vendor/bin/phpcs -p -s --parallel=$(nproc) --ignore=lib/Drupal/Core/Command/GenerateTheme.php,modules/mysql/tests/src/Kernel/mysql/Console/DbDumpCommandTest.php
99+
../../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

coder_sniffer/Drupal/ruleset.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@
188188

189189
<rule ref="Squiz.Classes.ClassFileName">
190190
<!-- Disable class name to file name matching in Test files. -->
191-
<exclude-pattern>*/tests/*/*Test.php</exclude-pattern>
191+
<exclude-pattern>*/tests/*/*(Test|TestBase).php</exclude-pattern>
192192
</rule>
193193
<rule ref="Squiz.ControlStructures.ForEachLoopDeclaration"/>
194194
<!-- Disable some error messages that we already cover. -->

0 commit comments

Comments
 (0)