From fac6e837052bd78b124b6065049c11ed172d1846 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Thu, 22 Jun 2023 23:29:15 -0400 Subject: [PATCH] Avoid --- scripts/update_schemastore.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/update_schemastore.py b/scripts/update_schemastore.py index 685fa7bbff..2637a45722 100644 --- a/scripts/update_schemastore.py +++ b/scripts/update_schemastore.py @@ -47,9 +47,16 @@ def update_schemastore(schemastore: Path) -> None: cwd=schemastore, ) - # Update the schema and format appropriately + # Update the schema and format appropriately. schema = json.loads(root.joinpath("ruff.schema.json").read_text()) schema["$id"] = "https://json.schemastore.org/ruff.json" + + # Rewrite any `uint8` types to `uint`. `uint8` seems to be unsupported by + # SchemaStore. + for definition in schema['definitions']: + if schema['definitions'][definition].get("format") == "uint8": + schema['definitions'][definition]['format'] = 'uint' + schemastore.joinpath(ruff_json).write_text( json.dumps(dict(sorted(schema.items())), indent=2, ensure_ascii=False), )