File tree Expand file tree Collapse file tree 3 files changed +21
-1
lines changed Expand file tree Collapse file tree 3 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -351,7 +351,7 @@ public function process(File $phpcsFile, $stackPtr)
351
351
// Also, when the comment starts with cspell: don't check the end of the
352
352
// comment.
353
353
if (preg_match ('/^\p{L}/u ' , $ commentText ) === 1
354
- && strpos ( $ commentText , ' cspell: ' ) ! == 0
354
+ && preg_match ( ' /( cspell|spell\-checker):ignore/i ' , $ commentText ) = == 0
355
355
) {
356
356
$ commentCloser = $ commentText [(strlen ($ commentText ) - 1 )];
357
357
$ acceptedClosers = [
Original file line number Diff line number Diff line change @@ -116,3 +116,13 @@ function test2() {
116
116
117
117
return $ x ;
118
118
}
119
+
120
+ // Allow all the cspell comment variants.
121
+ // cspell:ignore bananarama
122
+ $ x = 1 ;
123
+ // With some comment before it.
124
+ // cSpell:ignore bananarama
125
+ $ x = 2 ;
126
+ // And here as well.
127
+ // spell-checker:ignore bananarama
128
+ $ x = 3 ;
Original file line number Diff line number Diff line change @@ -115,3 +115,13 @@ function test2() {
115
115
116
116
return $x;
117
117
}
118
+
119
+ // Allow all the cspell comment variants.
120
+ // cspell:ignore bananarama
121
+ $x = 1;
122
+ // With some comment before it.
123
+ // cSpell:ignore bananarama
124
+ $x = 2;
125
+ // And here as well.
126
+ // spell-checker:ignore bananarama
127
+ $x = 3;
You can’t perform that action at this time.
0 commit comments