feat: add yamlfmt config to hk builtin config#505
Conversation
|
bugbot run |
| glob = List("**/*.yml", "**/*.yaml") | ||
| stage = "<JOB_FILES>" | ||
| check = "yamlfmt -lint -quiet {{ files }}" | ||
| check_diff = "yamlfmt -lint {{ files }}" |
There was a problem hiding this comment.
Bug: check_diff command may not produce actual diff output
The check_diff command is yamlfmt -lint {{ files }}, which just removes -quiet from the check command. However, all other builtins that define check_diff use an explicit diff flag (like --diff or -d). The check_diff field is documented as "A command that shows the diff of what would be changed" - simply removing -quiet likely produces more verbose error messages rather than an actual unified diff. The command may need yamlfmt's -d flag (dry run with diff output) to match the expected behavior.
There was a problem hiding this comment.
yamlfmt outputs diff by default. Therefore, the -d flag or similar is not needed.
Example:
$ cat a.yml
---
a: 1
$ yamlfmt --lint a.yml
The following formatting differences were found:
a.yml:
- ---
a: 1 a: 1
$ yamlfmt --lint --quiet a.yml
The following files had formatting differences:
a.ymlc7912dc to
44422c9
Compare
pkl/builtins/yamlfmt.pkl
Outdated
| yamlfmt = new Config.Step { | ||
| glob = List("**/*.yml", "**/*.yaml") | ||
| stage = "<JOB_FILES>" | ||
| check = "yamlfmt -lint -quiet {{ files }}" |
There was a problem hiding this comment.
you shouldn't include a check command if there is check_diff
44422c9 to
26cf929
Compare
## [1.27.0](https://github.com/jdx/hk/compare/v1.26.0..v1.27.0) - 2025-12-12 ### 🚀 Features - **(lychee)** new builtin by [@scop](https://github.com/scop) in [#510](#510) - **(tombi)** add tombi config to hk builtin config by [@hituzi-no-sippo](https://github.com/hituzi-no-sippo) in [#511](#511) - Apply the step glob to the test files fallback by [@thejcannon](https://github.com/thejcannon) in [#498](#498) - Support `hk.local.pkl` by [@thejcannon](https://github.com/thejcannon) in [#504](#504) - add yamlfmt config to hk builtin config by [@hituzi-no-sippo](https://github.com/hituzi-no-sippo) in [#505](#505) - add `HK_PKL_HTTP_REWRITE` envvar by [@thejcannon](https://github.com/thejcannon) in [#512](#512) ### 🐛 Bug Fixes - **(builtins)** use `stage = "<JOB_FILES>"` for fix_smart_quotes builtin by [@joonas](https://github.com/joonas) in [#503](#503) - add new mise builtin to Builtins.pkl by [@hisaac](https://github.com/hisaac) in [#492](#492) - preserve file permissions in fix-smart-quotes util by [@joonas](https://github.com/joonas) in [#506](#506) ### 🚜 Refactor - Turn on `taplo-format` by [@thejcannon](https://github.com/thejcannon) in [#501](#501) ### 📚 Documentation - Generate config docs from the pkl by [@thejcannon](https://github.com/thejcannon) in [#499](#499) ### 🧪 Testing - Move `ruff` to tool stub and fix up tests by [@thejcannon](https://github.com/thejcannon) in [#487](#487) - Do some test gardening by [@thejcannon](https://github.com/thejcannon) in [#497](#497) - Clean up `test/pkl_config_errors.bats` by [@thejcannon](https://github.com/thejcannon) in [#500](#500) - add yamllint tests by [@thejcannon](https://github.com/thejcannon) in [#509](#509) ### 📦️ Dependency Updates - update swatinem/rust-cache digest to 779680d by [@renovate[bot]](https://github.com/renovate[bot]) in [#495](#495) - update anthropics/claude-code-action digest to 6337623 by [@renovate[bot]](https://github.com/renovate[bot]) in [#494](#494) - lock file maintenance by [@renovate[bot]](https://github.com/renovate[bot]) in [#502](#502) ### New Contributors - @hituzi-no-sippo made their first contribution in [#511](#511) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Bumps project to v1.27.0, updates docs/examples and CLI metadata, refreshes init template and changelog, and updates dependency lockfile. > > - **Release/versioning** > - Bump version to `1.27.0` in `Cargo.toml`, `hk.usage.kdl`, `docs/cli/commands.json`, and across docs/examples (`amends`/`import` URLs). > - Add `1.27.0` section to `CHANGELOG.md`. > - **Docs** > - Update pkl import references to `v1.27.0` throughout `docs/*` and `pkl/Config.pkl` docstrings. > - **CLI/init** > - Update `src/cli/init.rs` template to reference `v1.27.0`. > - Adjust error hint in `src/config.rs` to new versioned URL. > - **Dependencies** > - Refresh `Cargo.lock` with crate updates (e.g., `reqwest`, `git2`, `libgit2-sys`, `tower-http`, compression libs). > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 342dc3f. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: mise-en-dev <[email protected]>
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [hk](https://github.com/jdx/hk) | minor | `1.26.0` -> `1.27.0` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>jdx/hk (hk)</summary> ### [`v1.27.0`](https://github.com/jdx/hk/blob/HEAD/CHANGELOG.md#1270---2025-12-12) [Compare Source](jdx/hk@v1.26.0...v1.27.0) ##### 🚀 Features - **(lychee)** new builtin by [@​scop](https://github.com/scop) in [#​510](jdx/hk#510) - **(tombi)** add tombi config to hk builtin config by [@​hituzi-no-sippo](https://github.com/hituzi-no-sippo) in [#​511](jdx/hk#511) - Apply the step glob to the test files fallback by [@​thejcannon](https://github.com/thejcannon) in [#​498](jdx/hk#498) - Support `hk.local.pkl` by [@​thejcannon](https://github.com/thejcannon) in [#​504](jdx/hk#504) - add yamlfmt config to hk builtin config by [@​hituzi-no-sippo](https://github.com/hituzi-no-sippo) in [#​505](jdx/hk#505) - add `HK_PKL_HTTP_REWRITE` envvar by [@​thejcannon](https://github.com/thejcannon) in [#​512](jdx/hk#512) ##### 🐛 Bug Fixes - **(builtins)** use `stage = "<JOB_FILES>"` for fix\_smart\_quotes builtin by [@​joonas](https://github.com/joonas) in [#​503](jdx/hk#503) - add new mise builtin to Builtins.pkl by [@​hisaac](https://github.com/hisaac) in [#​492](jdx/hk#492) - preserve file permissions in fix-smart-quotes util by [@​joonas](https://github.com/joonas) in [#​506](jdx/hk#506) ##### 🚜 Refactor - Turn on `taplo-format` by [@​thejcannon](https://github.com/thejcannon) in [#​501](jdx/hk#501) ##### 📚 Documentation - Generate config docs from the pkl by [@​thejcannon](https://github.com/thejcannon) in [#​499](jdx/hk#499) ##### 🧪 Testing - Move `ruff` to tool stub and fix up tests by [@​thejcannon](https://github.com/thejcannon) in [#​487](jdx/hk#487) - Do some test gardening by [@​thejcannon](https://github.com/thejcannon) in [#​497](jdx/hk#497) - Clean up `test/pkl_config_errors.bats` by [@​thejcannon](https://github.com/thejcannon) in [#​500](jdx/hk#500) - add yamllint tests by [@​thejcannon](https://github.com/thejcannon) in [#​509](jdx/hk#509) ##### 📦️ Dependency Updates - update swatinem/rust-cache digest to [`779680d`](jdx/hk@779680d) by [@​renovate\[bot\]](https://github.com/renovate\[bot]) in [#​495](jdx/hk#495) - update anthropics/claude-code-action digest to [`6337623`](jdx/hk@6337623) by [@​renovate\[bot\]](https://github.com/renovate\[bot]) in [#​494](jdx/hk#494) - lock file maintenance by [@​renovate\[bot\]](https://github.com/renovate\[bot]) in [#​502](jdx/hk#502) ##### New Contributors - [@​hituzi-no-sippo](https://github.com/hituzi-no-sippo) made their first contribution in [#​511](jdx/hk#511) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0Mi40OC4wIiwidXBkYXRlZEluVmVyIjoiNDIuNDguMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90Il19-->
Add yamlfmt as a new builtin linter/formatter for YAML files.
There is no documentation about pull requests in
CONTRIBUTING.md, and this is my first contribution to hk, so I apologize if I'm doing something wrong.Note
Introduce
yamlfmtbuiltin with check/fix commands and tests; register it inBuiltins.pkl.yamlfmtinpkl/Builtins.pkl.pkl/builtins/yamlfmt.pkl:globfor**/*.ymland**/*.yaml.check(yamlfmt -lint -quiet),check_diff(-lint), andfix.yamlfmt.yamlto avoid system config.Written by Cursor Bugbot for commit 3a57adb. This will update automatically on new commits. Configure here.