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)
351351 // Also, when the comment starts with cspell: don't check the end of the
352352 // comment.
353353 if (preg_match ('/^\p{L}/u ' , $ commentText ) === 1
354- && strpos ( $ commentText , ' cspell: ' ) ! == 0
354+ && preg_match ( ' /( cspell|spell\-checker):ignore/i ' , $ commentText ) = == 0
355355 ) {
356356 $ commentCloser = $ commentText [(strlen ($ commentText ) - 1 )];
357357 $ acceptedClosers = [
Original file line number Diff line number Diff line change @@ -116,3 +116,13 @@ function test2() {
116116
117117 return $ x ;
118118}
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() {
115115
116116 return $x;
117117}
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