mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-06-25 18:24:03 +08:00
Check pyrightconfig stricter exclude list order (#15243)
This commit is contained in:
@@ -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
|
||||
# ====================================================================
|
||||
|
||||
Reference in New Issue
Block a user