Skip to content

Publish a JSON Schema of jevgate.toml - #13

Merged
tauanbinato merged 2 commits into
mainfrom
config-schema
Sep 25, 2026
Merged

tauanbinato merged 2 commits into
mainfrom
config-schema

Conversation

@tauanbinato

Copy link
Copy Markdown
Contributor

What and why

Phase 3 of the roadmap: editors with TOML schema support (Even Better TOML, Taplo) can complete and check jevgate.toml.

  • jevgate.schema.json is generated from the configuration types (schemars, a dev-dependency only; the binary doesn't change size) with each field's doc comment as its description, then filled in with every rule ID, key and group, the gate levels, and the limits the loader enforces (concurrency 1-8, positive budgets). TOML has no null, so optional values are plain types, and generated defaults are dropped since the descriptions state the real ones.
  • A test regenerates it and fails when the checked-in file differs (JEVGATE_WRITE_SCHEMA=1 cargo test rewrites it), so it can't drift from the loader.
  • jevgate init writes #:schema .../vX.Y.Z/jevgate.schema.json, pinned to its own release; this repository's jevgate.toml uses the local file.

How it was checked

With Python's jsonschema, the schema is a valid draft 2020-12 schema; this repository's jevgate.toml, jevgate init's output and the README example validate; a misspelled key, an unknown level, a misspelled rule and concurrency = 9 are rejected.

Listing it in SchemaStore (so editors find it for any jevgate.toml without the directive) is a pull request to SchemaStore, left for later.

jevgate.schema.json is generated by a test from the configuration types, with every rule name, level and limit, and the test fails when it is out of date. jevgate init writes a #:schema line so editors complete and check the file.
@tauanbinato
tauanbinato merged commit 0bc331c into main Sep 25, 2026
12 checks passed
@tauanbinato
tauanbinato deleted the config-schema branch September 25, 2026 22:12
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.

1 participant