From cea59b44257a86951992669066944d4e3ac4fbf5 Mon Sep 17 00:00:00 2001 From: Micha Reiser Date: Thu, 29 Feb 2024 19:21:54 +0100 Subject: [PATCH] Fix the sorting of the schema submited to schemastore (#10173) --- scripts/update_schemastore.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/scripts/update_schemastore.py b/scripts/update_schemastore.py index 949ff6822c..7f45f9b331 100644 --- a/scripts/update_schemastore.py +++ b/scripts/update_schemastore.py @@ -55,9 +55,18 @@ def update_schemastore(schemastore: Path) -> None: schema = json.loads(root.joinpath("ruff.schema.json").read_text()) schema["$id"] = "https://json.schemastore.org/ruff.json" src.joinpath(ruff_json).write_text( - json.dumps(dict(sorted(schema.items())), indent=2, ensure_ascii=False), + json.dumps(dict(schema.items()), indent=2, ensure_ascii=False), + ) + check_call( + [ + "node_modules/.bin/prettier", + "--plugin", + "prettier-plugin-sort-json", + "--write", + ruff_json, + ], + cwd=src, ) - check_call(["node_modules/.bin/prettier", "--write", ruff_json], cwd=src) # Check if the schema has changed # https://stackoverflow.com/a/9393642/3549270