This commit is contained in:
Charlie Marsh 2023-06-22 23:29:15 -04:00
parent 1cf307c34c
commit fac6e83705
1 changed files with 8 additions and 1 deletions

View File

@ -47,9 +47,16 @@ def update_schemastore(schemastore: Path) -> None:
cwd=schemastore, 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 = json.loads(root.joinpath("ruff.schema.json").read_text())
schema["$id"] = "https://json.schemastore.org/ruff.json" 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( schemastore.joinpath(ruff_json).write_text(
json.dumps(dict(sorted(schema.items())), indent=2, ensure_ascii=False), json.dumps(dict(sorted(schema.items())), indent=2, ensure_ascii=False),
) )