Conversation
- Update spellchecker:off/on regex pattern to use [\\s\\S]* instead of .*?\\n This fixes issue where multiline content was not properly ignored - Apply same fix to HTML comment variant - Add trailing comma to maintain consistency with formatting rules This aligns with the same fix applied to the Python SDK.
commit: |
There was a problem hiding this comment.
Pull request overview
This PR updates the regex patterns in typos.toml to better handle multiline spellchecker directives by replacing newline-specific matching with [\s\S]* (which matches any character including newlines), and adds a trailing comma for consistency.
- Updated spellchecker:off/on regex patterns to use
[\s\S]*for better multiline support - Applied the same fix to both comment-style and HTML-style patterns
- Added trailing comma to the last array element
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| extend-ignore-re = [ | ||
| "(?s)(#|//)\\s*spellchecker:off.*?\\n\\s*(#|//)\\s*spellchecker:on", | ||
| "(?s)<!--\\s*spellchecker:off.*?\\n\\s*spellchecker:on\\s*-->", | ||
| "(?s)(#|//)\\s*spellchecker:off[\\s\\S]*?(#|//)\\s*spellchecker:on", |
There was a problem hiding this comment.
The updated regex pattern removes the newline requirement and whitespace matching before the second comment marker. This could cause the pattern to match unintended content. For example, it could match cases where "spellchecker:on" appears in the middle of a line without a proper comment marker prefix.
The pattern should probably be:
"(?s)(#|//)\\s*spellchecker:off[\\s\\S]*?\\s*(#|//)\\s*spellchecker:on"
This ensures that whitespace is matched before the second comment marker, making the pattern more robust.
| "(?s)(#|//)\\s*spellchecker:off[\\s\\S]*?(#|//)\\s*spellchecker:on", | |
| "(?s)(#|//)\\s*spellchecker:off[\\s\\S]*?\\s*(#|//)\\s*spellchecker:on", |
Fixes the typos ignore regex pattern for better handling of multiline spellchecker directives.
This aligns with the fix applied to the Python SDK (stackone-ai-python#74).
Summary by cubic
Fix the typos ignore regex so spellchecker:off/on correctly ignores multiline blocks, including HTML comments. Switch to [\s\S]* for matching across newlines and add a trailing comma for consistency.
Written for commit dd8ecb3. Summary will update automatically on new commits.