diff --git a/coder_sniffer/Drupal/Sniffs/Commenting/InlineCommentSniff.php b/coder_sniffer/Drupal/Sniffs/Commenting/InlineCommentSniff.php index 3fdb4049..f226d61f 100644 --- a/coder_sniffer/Drupal/Sniffs/Commenting/InlineCommentSniff.php +++ b/coder_sniffer/Drupal/Sniffs/Commenting/InlineCommentSniff.php @@ -351,7 +351,7 @@ public function process(File $phpcsFile, $stackPtr) // Also, when the comment starts with cspell: don't check the end of the // comment. if (preg_match('/^\p{L}/u', $commentText) === 1 - && preg_match('/(cspell|spell\-checker):/i', $commentText) === 0 + && preg_match('/(cspell|spell\-checker|spellchecker):/i', $commentText) === 0 ) { $commentCloser = $commentText[(strlen($commentText) - 1)]; $acceptedClosers = [ diff --git a/tests/Drupal/Commenting/InlineCommentUnitTest.inc b/tests/Drupal/Commenting/InlineCommentUnitTest.inc index 401d02fc..5755af9f 100644 --- a/tests/Drupal/Commenting/InlineCommentUnitTest.inc +++ b/tests/Drupal/Commenting/InlineCommentUnitTest.inc @@ -126,3 +126,6 @@ $x = 2; // And here as well. // spell-checker:ignore bananarama $x = 3; +// Different keword. +// spellchecker:disable-next-line +$x = 4; diff --git a/tests/Drupal/Commenting/InlineCommentUnitTest.inc.fixed b/tests/Drupal/Commenting/InlineCommentUnitTest.inc.fixed index fabc368f..16297513 100644 --- a/tests/Drupal/Commenting/InlineCommentUnitTest.inc.fixed +++ b/tests/Drupal/Commenting/InlineCommentUnitTest.inc.fixed @@ -125,3 +125,6 @@ $x = 2; // And here as well. // spell-checker:ignore bananarama $x = 3; +// Different keword. +// spellchecker:disable-next-line +$x = 4;