diff --git a/Backdrop/Sniffs/Commenting/InlineCommentSniff.php b/Backdrop/Sniffs/Commenting/InlineCommentSniff.php index 6cbc2e9..3888035 100644 --- a/Backdrop/Sniffs/Commenting/InlineCommentSniff.php +++ b/Backdrop/Sniffs/Commenting/InlineCommentSniff.php @@ -216,6 +216,12 @@ public function process(File $phpcsFile, $stackPtr) break; } + // Comments for cspell exclude or include patterns also mean a new + // section. + if (preg_match('|^//[\s]*cspell:|', $tokens[$nextComment]['content']) === 1) { + break; + } + $commentTokens[] = $nextComment; $lastComment = $nextComment; }//end while