chore: format

This commit is contained in:
Timothy Jaeryang Baek
2026-02-11 16:24:11 -06:00
parent 89fddcc741
commit f376d4f378
202 changed files with 8328 additions and 2046 deletions
+4 -3
View File
@@ -2,7 +2,9 @@ import re
# ANSI escape code pattern - matches all common ANSI sequences
# This includes color codes, cursor movement, and other terminal control sequences
ANSI_ESCAPE_PATTERN = re.compile(r'\x1b\[[0-9;]*[A-Za-z]|\x1b\([AB]|\x1b[PX^_].*?\x1b\\|\x1b\].*?(?:\x07|\x1b\\)')
ANSI_ESCAPE_PATTERN = re.compile(
r"\x1b\[[0-9;]*[A-Za-z]|\x1b\([AB]|\x1b[PX^_].*?\x1b\\|\x1b\].*?(?:\x07|\x1b\\)"
)
def strip_ansi_codes(text: str) -> str:
@@ -18,7 +20,7 @@ def strip_ansi_codes(text: str) -> str:
- Reset codes: \x1b[0m, \x1b[39m
- Cursor movement: \x1b[1A, \x1b[2J, etc.
"""
return ANSI_ESCAPE_PATTERN.sub('', text)
return ANSI_ESCAPE_PATTERN.sub("", text)
def strip_markdown_code_fences(code: str) -> str:
@@ -55,4 +57,3 @@ def sanitize_code(code: str) -> str:
code = strip_ansi_codes(code)
code = strip_markdown_code_fences(code)
return code