Skip to content
Snippets Groups Projects
Unverified Commit b4972e78 authored by Klaus Purer's avatar Klaus Purer Committed by GitHub
Browse files

fix(InlineComment): Fix cspell ignore detection (#/3424914)

parent 87391036
No related branches found
No related tags found
No related merge requests found
......@@ -351,7 +351,7 @@ class InlineCommentSniff implements Sniff
// 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 = [
......
......@@ -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;
......@@ -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;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment