Skip to content

feat(cli): YAML config support + published JSON Schema#34

Merged
PunGrumpy merged 4 commits into
mainfrom
feat/yaml-config
Jul 25, 2026
Merged

feat(cli): YAML config support + published JSON Schema#34
PunGrumpy merged 4 commits into
mainfrom
feat/yaml-config

Conversation

@PunGrumpy

Copy link
Copy Markdown
Owner

What

Infra users live in YAML (they're writing Compose files anyway) — docker-doctor's config now meets them there.

YAML config files

docker-doctor.config.yaml / .yml join the resolution order (appended after .json, so existing projects resolve identically) and work with --config <path> too. Parsing reuses the yaml dependency the Compose parser already ships — zero new dependencies. Unlike .ts/.js configs, YAML/JSON need no "type": "module" in package.json.

Published JSON Schema

The website serves /schema.json, generated from allRules at build time (Next.js force-static route handler) — every rule key autocompletes with its description, categories and severities are enums, and it can never drift from the rule set. Editors pick it up via:

# yaml-language-server: $schema=https://docker-doctor.vercel.app/schema.json
rules:
  "docker-doctor/no-root-user": error

or a "$schema" key in JSON configs (the validator already strips unknown top-level keys, so $schema is safe at runtime).

Cleanup folded in

  • apps/web now depends on @docker-doctor/core (workspace) for the schema route; web tsconfig target bumped ES2017 → ES2022 to typecheck core's named-capture-group regexes.
  • Removed the config test suite's expectPartialCategories cast workaround — dead since categories became Partial<Record<…>> in feat(cli): export DockerDoctorConfig type and defineConfig helper #33.

Testing

  • 7 new loader tests: .yaml / .yml load, .json-over-.yaml precedence, malformed YAML → ConfigError, invalid severity in YAML → ConfigError, --config custom.yaml. Suite: 88 core + 15 CLI pass; typecheck + ultracite clean.
  • Web build prerenders /schema.json; verified the emitted body contains all five categories and generated rule keys.
  • E2E on a fixture: a .yaml config through the built CLI drops pin-image-version (rule off) and prefer-slim (Image Size off) while no-root-user still fires.

Changeset: patch bump for @docker-doctor/cli.

🤖 Generated with Claude Code

Add docker-doctor.config.yaml/.yml to config resolution (after .json,
also via --config) using the yaml dependency the Compose parser already
ships. The website now serves /schema.json — generated from allRules at
build time — so YAML ("# yaml-language-server: $schema=…") and JSON
("$schema" key) configs get editor autocomplete and validation.

Also drop the config test suite's expectPartialCategories workaround,
dead since DockerDoctorConfig.categories became Partial.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 25, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docker-doctor Ready Ready Preview, Comment Jul 25, 2026 4:06pm

@github-actions

github-actions Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

React Doctor found no new issues. 🎉

Reviewed by React Doctor for commit a1bc55d.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The bundled skill's config-format lists were stale after YAML support.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@PunGrumpy
PunGrumpy merged commit b730028 into main Jul 25, 2026
9 checks passed
@PunGrumpy
PunGrumpy deleted the feat/yaml-config branch July 25, 2026 16:08
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