Context
The dprint command in lefthook.yml includes *.{ts,tsx,js,jsx,json,yml,yaml,md,toml} in its file glob. But dprint.json only configures 4 plugins: typescript, json, markdown, toml. No YAML plugin is loaded.
Symptom
npx dprint check lefthook.yml exits 14 ("No files found to format with the specified plugins"). Any pre-commit that touches a YAML file will hit this.
In practice lefthook's wrapper hides the failure in some paths (the recent lefthook.yml edit in #211 passed the hook despite the dprint exit code), so the bug is masked, not absent.
Reproduction
git add lefthook.yml `.github/workflows/ci.yml`
git commit -m "test"
# dprint hook should fail; instead, lefthook reports `dprint ✔️` and commit proceeds.
# Manually:
npx dprint check lefthook.yml
# -> exit 14, no plugins for .yml
Why it matters
- Mismatch between glob (intent: format YAML) and config (no plugin) means we expect a YAML formatter that doesn't exist.
- Adding any new
.yml file (e.g. another workflow) under current setup would expose this concretely.
- Confusing author experience: hook passes when it shouldn't.
Options
A. Install a YAML plugin in dprint.json.
- Add
https://plugins.dprint.dev/markdown-0.18.0.wasm style entry for YAML, or use dprint's built-in yaml support if newer versions cover it. Verify dprint plugin support for YAML first.
- Pros: matches the hook's stated intent; future-proof for any yml file.
- Cons: another dependency surface; need to confirm plugin version compatibility.
B. Drop YAML from lefthook's dprint glob.
- Remove
yml,yaml from the glob. dprint won't try to format them.
- Pros: minimal change; no new dep.
- Cons: loses any intent of formatting YAML (yaml formatting isn't formalized in the repo anyway).
C. Audit scope: are there any .yml files we actually want formatted?
- Check
.github/workflows/, .github/ISSUE_TEMPLATE/ (none currently), lefthook.yml, dprint.json itself.
- Drive decision from data.
Recommendation
Start with C (1 minute). If at least one .yml file currently drifts, do A. If no .yml files have any practical format expectation, do B.
Related
Context
The
dprintcommand inlefthook.ymlincludes*.{ts,tsx,js,jsx,json,yml,yaml,md,toml}in its file glob. Butdprint.jsononly configures 4 plugins: typescript, json, markdown, toml. No YAML plugin is loaded.Symptom
npx dprint check lefthook.ymlexits 14 ("No files found to format with the specified plugins"). Any pre-commit that touches a YAML file will hit this.In practice lefthook's wrapper hides the failure in some paths (the recent lefthook.yml edit in #211 passed the hook despite the dprint exit code), so the bug is masked, not absent.
Reproduction
Why it matters
.ymlfile (e.g. another workflow) under current setup would expose this concretely.Options
A. Install a YAML plugin in
dprint.json.https://plugins.dprint.dev/markdown-0.18.0.wasmstyle entry for YAML, or use dprint's built-in yaml support if newer versions cover it. Verify dprint plugin support for YAML first.B. Drop YAML from lefthook's dprint glob.
yml,yamlfrom the glob. dprint won't try to format them.C. Audit scope: are there any
.ymlfiles we actually want formatted?.github/workflows/,.github/ISSUE_TEMPLATE/(none currently),lefthook.yml,dprint.jsonitself.Recommendation
Start with C (1 minute). If at least one
.ymlfile currently drifts, do A. If no.ymlfiles have any practical format expectation, do B.Related
dprint.jsonlefthook.yml(dprint command at lines 12-13 in original / re-numbered after feat: remove visual query builder #211)