Check pyrightconfig stricter exclude list order (#15243)

This commit is contained in:
Semyon Moroz
2026-01-15 11:32:58 +00:00
committed by GitHub
parent 6731a33cdb
commit 0c45df1544
3 changed files with 29 additions and 3 deletions
+10
View File
@@ -35,6 +35,16 @@ def strip_comments(text: str) -> str:
return text.split("#")[0].strip()
def json5_to_json(text: str) -> str:
"""Incomplete conversion from JSON5-like input to valid JSON."""
# Remove full-line // comments only
# (Can not remove inline comments)
text = re.sub(r"(?m)^\s*//.*\n?", "", text)
# Remove trailing commas before } or ]
text = re.sub(r",\s*([}\]])", r"\1", text)
return text
# ====================================================================
# Printing utilities
# ====================================================================