Repository navigation
Description
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 .ymlWhy 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
.ymlfile (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.wasmstyle 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,yamlfrom 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.jsonitself. - 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
- PR feat: remove visual query builder #211 added lint/type-check/clippy to pre-commit; surfaced this latent issue.
- dprint config:
dprint.json - lefthook config:
lefthook.yml(dprint command at lines 12-13 in original / re-numbered after feat: remove visual query builder #211)
Activity
fix: cell viewer modal renders blank content (#217) (#220)