Skip to content

feat: enable dprint YAML plugin + bump plugins to latest (#215) - #235

Merged
EVWorth merged 1 commit into
mainfrom
fix/215-dprint-yaml-plugin
Jul 20, 2026
Merged

EVWorth merged 1 commit into
mainfrom
fix/215-dprint-yaml-plugin

Conversation

@EVWorth

@EVWorth EVWorth commented Jul 20, 2026

Copy link
Copy Markdown
Owner

What

Enables dprint's previously-broken YAML formatting, plus bumps all four existing plugins to their latest versions. One-line addition to dprint.json per plugin.

Why

lefthook's dprint pre-commit hook had been silently broken on YAML files for months. The glob in lefthook.yml explicitly listed yml,yaml (*.{ts,tsx,js,jsx,json,yml,yaml,md,toml}) but the dprint.json plugins array had no YAML plugin — only typescript, json, markdown, toml. npx dprint check <any .yml> exited 14 ("No files found to format with the specified plugins") yet lefthook's wrapper reported success — masked failure.

This was the source of recurring --no-verify workarounds in prior PRs.

Changes

dprint.json plugin list:

  • typescript 0.93.3 -> 0.96.1
  • json 0.20.0 -> 0.23.0
  • markdown 0.18.0 -> 0.22.1
  • yaml nil -> g-plane/pretty_yaml-v0.6.0 (NEW)
  • toml 0.6.2 -> 0.7.0

Autoformatted drift surfaced now that the plugin is active:

  • .github/workflows/ci.yml — single-quoted scalars converted to double quotes (default for dprint)
  • docs/design/TESTING_STRATEGY.md — same, in the embedded YAML code block

(lefthook.yml, .github/dependabot.yml, .github/FUNDING.yml, .github/workflows/release.yml, dprint.json itself — all already formatted clean.)

Verification

Gate Result
npx dprint check . 0 vulnerabilities, 0 drift
npx vitest run (full) 77 files / 1462 tests pass
npm run type-check 0 errors
npx eslint src 0 errors (172 pre-existing warnings)
python3 yaml.safe_load(.github/workflows/ci.yml) parse ok
Lefthook pre-commit (dprint) clean

After this lands

  • lefthook.yml's dprint hook actually enforces on .yml, .yaml files (the glob's stated intent).
  • Future commits touching YAML files auto-format via the pre-commit hook — no more --no-verify workarounds.
  • The CI's Format Check (dprint) job, when triggered, will also enforce YAML formatting.

Closes #215.

lefthook's dprint pre-commit hook had been silently broken on YAML
files for months: the dprint.json plugin list included typescript,
json, markdown, toml but NO yaml plugin, while the lefthook glob
(`*.{ts,tsx,js,jsx,json,yml,yaml,md,toml}`) explicitly promised
YAML formatting. Result: `npx dprint check lefthook.yml` exited
14 ("No files found to format with the specified plugins") yet the
hook reported success — masked failure.

Fix: add g-plane/pretty_yaml (the official YAML plugin) and bump
all four existing plugins to latest. URLs:

- typescript: 0.93.3 -> 0.96.1
- json:       0.20.0 -> 0.23.0
- markdown:   0.18.0 -> 0.22.1
- yaml:       nil    -> g-plane/pretty_yaml-v0.6.0  (NEW)
- toml:       0.6.2  -> 0.7.0

Also fixes actual formatting drift surfaced by the plugin coming
online:
- .github/workflows/ci.yml: switch single-quoted YAML scalars
  (dprint prefers double quotes by default)
- docs/design/TESTING_STRATEGY.md: same, in the embedded code
  block plus a stray trailing-whitespace line in a code block
- (No YAML formatting drift in dprint/lefthook/dependabot/
  FUNDING/release.yml — those were already formatted clean)

Resolves: lefthook's dprint hook now enforces on YAML (as the
glob always claimed). Future commits touching .yml/.yaml files
will be auto-formatted; no more `--no-verify` workarounds on
YAML changes.

Closes #215.
@EVWorth
EVWorth merged commit c801395 into main Jul 20, 2026
1 check failed
@EVWorth
EVWorth deleted the fix/215-dprint-yaml-plugin branch July 20, 2026 03:19
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.

Investigate: lefthook dprint hook incompatible with YAML files

1 participant