Skip to content

Commit

Permalink
fix(InlineCommen): Allow spellchecker keyword (#3424914)
Browse files Browse the repository at this point in the history
  • Loading branch information
klausi committed Sep 22, 2024
1 parent 05c5367 commit c58e5a0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
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
&& preg_match('/(cspell|spell\-checker):/i', $commentText) === 0
&& preg_match('/(cspell|spell\-checker|spellchecker):/i', $commentText) === 0
) {
$commentCloser = $commentText[(strlen($commentText) - 1)];
$acceptedClosers = [
Expand Down
3 changes: 3 additions & 0 deletions tests/Drupal/Commenting/InlineCommentUnitTest.inc
Original file line number Diff line number Diff line change
Expand Up @@ -126,3 +126,6 @@ $x = 2;
// And here as well.
// spell-checker:ignore bananarama
$x = 3;
// Different keword.
// spellchecker:disable-next-line
$x = 4;
3 changes: 3 additions & 0 deletions tests/Drupal/Commenting/InlineCommentUnitTest.inc.fixed
Original file line number Diff line number Diff line change
Expand Up @@ -125,3 +125,6 @@ $x = 2;
// And here as well.
// spell-checker:ignore bananarama
$x = 3;
// Different keword.
// spellchecker:disable-next-line
$x = 4;

0 comments on commit c58e5a0

Please sign in to comment.