Skip to content

Fix invalid JSON in uf2families.json and add a JSON validation check - #111

Merged
Limor "Ladyada" Fried (ladyada) merged 2 commits into
microsoft:masterfrom
tyeth:fix-uf2families-json
Nov 10, 2026
Merged

Limor "Ladyada" Fried (ladyada) merged 2 commits into
microsoft:masterfrom
tyeth:fix-uf2families-json

Conversation

@tyeth

Copy link
Copy Markdown
Contributor

The Adaboot entry added in #108 is missing a comma after its "id" field, so utils/uf2families.json on master is no longer valid JSON. uf2conv.py fails as soon as it loads the families:

  File "uf2conv.py", line 263, in load_families
    raw_families = json.load(f)
json.decoder.JSONDecodeError: Expecting ',' delimiter: line 399 column 9 (char 9391)

Downstream CI that fetches uf2conv.py and uf2families.json straight from master started failing after #108 was merged. That includes Adafruit's ci-arduino, which every ESP32-S2/S3 and SAMD UF2 build uses.

Changes

  1. Fix the missing comma in the Adaboot entry (a one-character change).
  2. Add a Validate JSON workflow. It runs jq empty on every tracked *.json file on push and pull_request (only when JSON files or the workflow change), plus workflow_dispatch. The repo's only check today is CodeQL (javascript-typescript), which doesn't parse JSON, so it passed on Add Adaboot entry to uf2families.json #108.

Testing

I ran the workflow step locally with jq 1.7.1:

  • with this fix, both JSON files report OK
  • with the current master version of uf2families.json, the step exits 1 with jq: parse error: Expected separator between values at line 399, column 20
  • Python's json.load also parses the fixed file (80 families)

🤖 Generated with Claude Code

Tyeth Gundry (tyeth) and others added 2 commits November 10, 2026 13:50
The Adaboot entry added in microsoft#108 is missing a comma after its "id"
field, which makes uf2families.json invalid JSON. uf2conv.py fails in
load_families() with:

  json.decoder.JSONDecodeError: Expecting ',' delimiter: line 399 column 9

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Run jq over every tracked *.json file on push and pull_request so a
syntax error in utils/uf2families.json (like the missing comma fixed in
the previous commit) fails CI instead of breaking downstream users of
uf2conv.py, many of which fetch the file straight from master.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tyeth

Copy link
Copy Markdown
Contributor Author

@microsoft-github-policy-service agree company="Adafruit"

@tyeth

Copy link
Copy Markdown
Contributor Author

@microsoft-github-policy-service agree

@tyeth

Copy link
Copy Markdown
Contributor Author

Scott Shawcroft (@tannewt) or Limor "Ladyada" Fried (@ladyada) please review and merge at your convenience.

@ladyada
Limor "Ladyada" Fried (ladyada) merged commit 70fdee5 into microsoft:master Nov 10, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants