Skip to content

Commit 136ca75

Browse files
fix(schema): terminate generated JSON with a trailing newline
pretty-format-json (pre-commit) rewrites schema/schema.json and schema/meta.json because gen_all wrote them via json.dumps(indent=2) with no trailing newline. Content is otherwise identical to the hook's output, so add the newline in download_schema (keeping regeneration idempotent) and to the committed files. Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
1 parent ecc5522 commit 136ca75

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

schema/meta.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,4 @@
4949
"protocolMethods": {
5050
"cancel_request": "$/cancel_request"
5151
}
52-
}
52+
}

schema/schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10229,4 +10229,4 @@
1022910229
"x-method": "$/cancel_request"
1023010230
}
1023110231
}
10232-
}
10232+
}

scripts/gen_all.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,8 @@ def download_schema(repo: str, ref: str) -> None:
140140
print(exc, file=sys.stderr)
141141
sys.exit(1)
142142

143-
SCHEMA_JSON.write_text(json.dumps(schema_data, indent=2), encoding="utf-8")
144-
META_JSON.write_text(json.dumps(meta_data, indent=2), encoding="utf-8")
143+
SCHEMA_JSON.write_text(json.dumps(schema_data, indent=2) + "\n", encoding="utf-8")
144+
META_JSON.write_text(json.dumps(meta_data, indent=2) + "\n", encoding="utf-8")
145145
VERSION_FILE.write_text(ref + "\n", encoding="utf-8")
146146
print(f"Fetched schema and meta from {repo}@{ref}")
147147

0 commit comments

Comments
 (0)