Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
&& strpos($commentText, 'cspell:') !== 0
&& preg_match('/(cspell|spell\-checker):ignore/i', $commentText) === 0
) {
$commentCloser = $commentText[(strlen($commentText) - 1)];
$acceptedClosers = [
Expand Down
10 changes: 10 additions & 0 deletions tests/Drupal/Commenting/InlineCommentUnitTest.inc
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,13 @@ function test2() {

return $x;
}

// Allow all the cspell comment variants.
// cspell:ignore bananarama
$x = 1;
// With some comment before it.
// cSpell:ignore bananarama
$x = 2;
// And here as well.
// spell-checker:ignore bananarama
$x = 3;
10 changes: 10 additions & 0 deletions tests/Drupal/Commenting/InlineCommentUnitTest.inc.fixed
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,13 @@ function test2() {

return $x;
}

// Allow all the cspell comment variants.
// cspell:ignore bananarama
$x = 1;
// With some comment before it.
// cSpell:ignore bananarama
$x = 2;
// And here as well.
// spell-checker:ignore bananarama
$x = 3;
Loading