Repository navigation
feat: enable dprint YAML plugin + bump plugins to latest (#215) - #235
Merged
Merged
Conversation
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.
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Enables dprint's previously-broken YAML formatting, plus bumps all four existing plugins to their latest versions. One-line addition to
dprint.jsonper plugin.Why
lefthook's dprint pre-commit hook had been silently broken on YAML files for months. The glob in
lefthook.ymlexplicitly listedyml,yaml(*.{ts,tsx,js,jsx,json,yml,yaml,md,toml}) but the dprint.jsonpluginsarray 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-verifyworkarounds in prior PRs.Changes
dprint.jsonplugin list: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.jsonitself — all already formatted clean.)Verification
npx dprint check .npx vitest run(full)npm run type-checknpx eslint srcpython3 yaml.safe_load(.github/workflows/ci.yml)dprint)After this lands
lefthook.yml's dprint hook actually enforces on.yml,.yamlfiles (the glob's stated intent).--no-verifyworkarounds.Format Check (dprint)job, when triggered, will also enforce YAML formatting.Closes #215.