Skip to content

Comments

feat: use recursive glob patterns in all builtins#383

Merged
jdx merged 1 commit intomainfrom
feat/recursive-glob-patterns-in-builtins
Nov 1, 2025
Merged

feat: use recursive glob patterns in all builtins#383
jdx merged 1 commit intomainfrom
feat/recursive-glob-patterns-in-builtins

Conversation

@jdx
Copy link
Owner

@jdx jdx commented Nov 1, 2025

Summary

  • Changed all builtin glob patterns from *.ext to **/*.ext for recursive file matching
  • Converted brace expansion patterns to explicit List() entries
  • Updated 67 builtin files across both glob and stage fields

Problem

Builtins were using single-level glob patterns like *.py which only match files in the current directory. This limits their usefulness in projects with nested directory structures.

Solution

Updated all builtin glob patterns to use recursive matching with **/*.ext syntax. This allows builtins to find and process files in subdirectories.

Also converted brace expansion patterns like *.{ts,tsx} to explicit list entries: List("**/*.ts", "**/*.tsx") to avoid shell expansion issues.

Examples

  • glob = "*.py"glob = "**/*.py"
  • glob = "*.rs" + stage = "*.rs"glob = "**/*.rs" + stage = "**/*.rs"
  • glob = "*.{ts,tsx}"glob = List("**/*.ts", "**/*.tsx")
  • .github/workflows/*.yml.github/workflows/**/*.yml

Test plan

  • All builtin tests pass with both libgit2 and shell git
  • Verified 67 files updated correctly
  • No brace expansion patterns remain in glob/stage fields

🤖 Generated with Claude Code


Note

Convert all builtin glob/stage patterns to recursive */ and replace brace expansions with explicit List entries, including splitting YAML workflow patterns.

  • Builtins (glob/stage patterns):
    • Switch *.ext**/*.ext across all tools; mirror changes in stage where present.
    • Replace brace expansions with explicit List(...) (e.g., TS/JS, YAML/YML, C/C++ variants).
  • Notable specifics:
    • actionlint: .github/workflows/*.{yml,yaml}List(".github/workflows/*.yml", ".github/workflows/*.yaml").
    • Project-wide files: **/package.json, **/go.mod now used for both glob and stage.
    • General linters/formatters (e.g., Python, Go, Rust, Ruby, Shell, Nix, SQL, Swift, Lua, Markdown, TOML, XML) updated to recursive patterns.
    • Generic checks (mixed_line_ending, newlines, trailing_whitespace) broadened from * to **/*.

Written by Cursor Bugbot for commit 6e2a48d. This will update automatically on new commits. Configure here.

@jdx jdx force-pushed the feat/recursive-glob-patterns-in-builtins branch from 47857e7 to 9e857c7 Compare November 1, 2025 21:41
cursor[bot]

This comment was marked as outdated.

Change all builtin glob patterns from `*.ext` to `**/*.ext` to enable
recursive file matching in subdirectories. This makes builtins more
flexible and allows them to find files in nested directory structures.

Changes:
- Updated 67 builtin files to use `**/*.ext` instead of `*.ext`
- Converted brace expansion patterns like `*.{ts,tsx}` to explicit
  List() entries with recursive patterns
- Applies to both `glob` and `stage` fields

Examples:
- `glob = "*.py"` → `glob = "**/*.py"`
- `glob = "*.{ts,tsx}"` → `glob = List("**/*.ts", "**/*.tsx")`
- `.github/workflows/*.yml` → `.github/workflows/**/*.yml`

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@jdx jdx force-pushed the feat/recursive-glob-patterns-in-builtins branch from 9e857c7 to 6e2a48d Compare November 1, 2025 21:47

actionlint = new Config.Step {
glob = List(".github/workflows/*.{yml,yaml}")
glob = List(".github/workflows/*.yml", ".github/workflows/*.yaml")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Recursive glob missing in actionlint update

The glob pattern for actionlint was not updated to use recursive matching as intended by the PR. The pattern .github/workflows/*.yml should be .github/workflows/**/*.yml to match workflow files in subdirectories. Currently, the change only converted the brace expansion *.{yml,yaml} to separate list entries, but did not add the recursive ** pattern as stated in the PR description and examples.

Fix in Cursor Fix in Web

@jdx jdx merged commit f231b9e into main Nov 1, 2025
16 checks passed
@jdx jdx deleted the feat/recursive-glob-patterns-in-builtins branch November 1, 2025 22:09
@jdx jdx mentioned this pull request Nov 1, 2025
jdx added a commit that referenced this pull request Nov 15, 2025
## [1.21.0](https://github.com/jdx/hk/compare/v1.20.0..v1.21.0) -
2025-11-15

### 🚀 Features

- **(dprint)** new builtin by [@scop](https://github.com/scop) in
[#402](#402)
- **(mypy,ruff,ruff_format)** associate with .pyi by
[@scop](https://github.com/scop) in
[#404](#404)
- **(prettier)** support Vue files by
[@minusfive](https://github.com/minusfive) in
[#388](#388)
- **(terraform,tofu)** include .tftest.hcl in glob by
[@scop](https://github.com/scop) in
[#397](#397)
- **(tflint)** add fix command by [@scop](https://github.com/scop) in
[#401](#401)
- **(typos)** new builtin by [@scop](https://github.com/scop) in
[#400](#400)
- use recursive glob patterns in all builtins by
[@jdx](https://github.com/jdx) in
[#383](#383)
- shfmt improvements by [@scop](https://github.com/scop) in
[#410](#410)
- add content-based file type matching by [@jdx](https://github.com/jdx)
in [#416](#416)
- add clap-sort unit test and sort CLI flags alphabetically by
[@jdx](https://github.com/jdx) in
[#419](#419)
- Add alternate config directory support with tests by
[@jdx](https://github.com/jdx) in
[#407](#407)

### 🐛 Bug Fixes

- **(golangci-lint)** check with --fix=false by
[@scop](https://github.com/scop) in
[#399](#399)
- **(shfmt)** don't pass -s by [@scop](https://github.com/scop) in
[#398](#398)
- **(tf_lint)** don't pass filenames by [@scop](https://github.com/scop)
in [#396](#396)
- Import elixir builtins by [@arthurcogo](https://github.com/arthurcogo)
in [#390](#390)
- Add warning for existing Git hooks path by
[@jdx](https://github.com/jdx) in
[#409](#409)
- prevent untracked files from being staged with <JOB_FILES> by
[@jdx](https://github.com/jdx) in
[#408](#408)

### 📚 Documentation

- Add Elixir builtins to docs by
[@arthurcogo](https://github.com/arthurcogo) in
[#389](#389)
- glossary grammar fix by [@scop](https://github.com/scop) in
[#395](#395)
- fix link to Pkl language docs by [@scop](https://github.com/scop) in
[#394](#394)

### 📦️ Dependency Updates

- update anthropics/claude-code-action digest to 8a1c437 by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#391](#391)
- update jdx/mise-action digest to be3be22 by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#392](#392)
- update github artifact actions (major) by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#393](#393)
- update rust crate infer to 0.19 by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#418](#418)
- update jdx/mise-action digest to 9dc7d5d by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#417](#417)

### New Contributors

- @scop made their first contribution in
[#410](#410)
- @arthurcogo made their first contribution in
[#390](#390)
- @minusfive made their first contribution in
[#388](#388)

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Cut v1.21.0: bump versions, add changelog, refresh CLI docs/usage with
alphabetized flags, update templates/messages, and tweak deps.
> 
> - **Release 1.21.0**:
> - Bump `hk` version to `1.21.0` across `Cargo.toml`, `Cargo.lock`,
`hk.usage.kdl`, docs, and example configs.
>   - Add `CHANGELOG.md` entry for 1.21.0.
> - **CLI/Docs**:
> - Regenerate `docs/cli/commands.json`, CLI markdown, and
`hk.usage.kdl` with alphabetized flags and reordered options (e.g.,
`--fix`, `--from-ref`, `--to-ref`, `--skip-step`).
>   - Update migration docs flag order (`--force` before `--output`).
>   - Update `hk test` flags (add `--list`, reorder `--name`/`--step`).
> - **Templates/References**:
> - Update Pkl `amends/import` URLs in examples and generator
(`src/cli/init.rs`) to `v1.21.0`.
>   - Update Pkl error hint in `src/config.rs` to reference `v1.21.0`.
> - **Dependencies**:
>   - Bump crates (`bytes` 1.11.0, `serde_with` 3.16.0) in `Cargo.lock`.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
93af5e6. 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]>
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Nov 21, 2025
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [hk](https://github.com/jdx/hk) | minor | `1.20.0` -> `1.22.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.22.0`](https://github.com/jdx/hk/blob/HEAD/CHANGELOG.md#1220---2025-11-19)

[Compare Source](jdx/hk@v1.21.1...v1.22.0)

##### 🚀 Features

- Add `stdin` to step config by [@&#8203;thejcannon](https://github.com/thejcannon) in [#&#8203;435](jdx/hk#435)

##### 🐛 Bug Fixes

- save patch backup files when using git as stash method by [@&#8203;jdx](https://github.com/jdx) in [#&#8203;434](jdx/hk#434)

##### 📚 Documentation

- Clarify `stash` default (behavior) by [@&#8203;thejcannon](https://github.com/thejcannon) in [#&#8203;431](jdx/hk#431)
- Clarify hook fix default by [@&#8203;thejcannon](https://github.com/thejcannon) in [#&#8203;433](jdx/hk#433)

### [`v1.21.1`](https://github.com/jdx/hk/blob/HEAD/CHANGELOG.md#1211---2025-11-19)

[Compare Source](jdx/hk@v1.21.0...v1.21.1)

##### 🐛 Bug Fixes

- **(ruff)** Make `ruff` respect user config `exclude` by [@&#8203;thejcannon](https://github.com/thejcannon) in [#&#8203;421](jdx/hk#421)
- **(ruff\_format)** Pass `--force-exclude` to `ruff format` (as well) by [@&#8203;thejcannon](https://github.com/thejcannon) in [#&#8203;428](jdx/hk#428)
- Fix --check docstring by [@&#8203;thejcannon](https://github.com/thejcannon) in [#&#8203;423](jdx/hk#423)
- Configuration Read Support YML File Extension by [@&#8203;hcoona](https://github.com/hcoona) in [#&#8203;427](jdx/hk#427)
- treat check\_list\_files stderr as informational, not an error by [@&#8203;jdx](https://github.com/jdx) in [#&#8203;425](jdx/hk#425)
- remove trailing whitespace in ruff\_format.pkl by [@&#8203;jdx](https://github.com/jdx) in [9f4abdc](jdx/hk@9f4abdc)

##### 🚜 Refactor

- Enable `trailing-whitespace` in this repo by [@&#8203;thejcannon](https://github.com/thejcannon) in [#&#8203;429](jdx/hk#429)

##### 📚 Documentation

- Don't suggest configuring hk in config env by [@&#8203;thejcannon](https://github.com/thejcannon) in [#&#8203;424](jdx/hk#424)

##### New Contributors

- [@&#8203;thejcannon](https://github.com/thejcannon) made their first contribution in [#&#8203;428](jdx/hk#428)
- [@&#8203;hcoona](https://github.com/hcoona) made their first contribution in [#&#8203;427](jdx/hk#427)

### [`v1.21.0`](https://github.com/jdx/hk/blob/HEAD/CHANGELOG.md#1210---2025-11-15)

[Compare Source](jdx/hk@v1.20.0...v1.21.0)

##### 🚀 Features

- **(dprint)** new builtin by [@&#8203;scop](https://github.com/scop) in [#&#8203;402](jdx/hk#402)
- **(mypy,ruff,ruff\_format)** associate with .pyi by [@&#8203;scop](https://github.com/scop) in [#&#8203;404](jdx/hk#404)
- **(prettier)** support Vue files by [@&#8203;minusfive](https://github.com/minusfive) in [#&#8203;388](jdx/hk#388)
- **(terraform,tofu)** include .tftest.hcl in glob by [@&#8203;scop](https://github.com/scop) in [#&#8203;397](jdx/hk#397)
- **(tflint)** add fix command by [@&#8203;scop](https://github.com/scop) in [#&#8203;401](jdx/hk#401)
- **(typos)** new builtin by [@&#8203;scop](https://github.com/scop) in [#&#8203;400](jdx/hk#400)
- use recursive glob patterns in all builtins by [@&#8203;jdx](https://github.com/jdx) in [#&#8203;383](jdx/hk#383)
- shfmt improvements by [@&#8203;scop](https://github.com/scop) in [#&#8203;410](jdx/hk#410)
- add content-based file type matching by [@&#8203;jdx](https://github.com/jdx) in [#&#8203;416](jdx/hk#416)
- add clap-sort unit test and sort CLI flags alphabetically by [@&#8203;jdx](https://github.com/jdx) in [#&#8203;419](jdx/hk#419)
- Add alternate config directory support with tests by [@&#8203;jdx](https://github.com/jdx) in [#&#8203;407](jdx/hk#407)

##### 🐛 Bug Fixes

- **(golangci-lint)** check with --fix=false by [@&#8203;scop](https://github.com/scop) in [#&#8203;399](jdx/hk#399)
- **(shfmt)** don't pass -s by [@&#8203;scop](https://github.com/scop) in [#&#8203;398](jdx/hk#398)
- **(tf\_lint)** don't pass filenames by [@&#8203;scop](https://github.com/scop) in [#&#8203;396](jdx/hk#396)
- Import elixir builtins by [@&#8203;arthurcogo](https://github.com/arthurcogo) in [#&#8203;390](jdx/hk#390)
- Add warning for existing Git hooks path by [@&#8203;jdx](https://github.com/jdx) in [#&#8203;409](jdx/hk#409)
- prevent untracked files from being staged with \<JOB\_FILES> by [@&#8203;jdx](https://github.com/jdx) in [#&#8203;408](jdx/hk#408)

##### 📚 Documentation

- Add Elixir builtins to docs by [@&#8203;arthurcogo](https://github.com/arthurcogo) in [#&#8203;389](jdx/hk#389)
- glossary grammar fix by [@&#8203;scop](https://github.com/scop) in [#&#8203;395](jdx/hk#395)
- fix link to Pkl language docs by [@&#8203;scop](https://github.com/scop) in [#&#8203;394](jdx/hk#394)

##### 📦️ Dependency Updates

- update anthropics/claude-code-action digest to [`8a1c437`](jdx/hk@8a1c437) by [@&#8203;renovate\[bot\]](https://github.com/renovate\[bot]) in [#&#8203;391](jdx/hk#391)
- update jdx/mise-action digest to [`be3be22`](jdx/hk@be3be22) by [@&#8203;renovate\[bot\]](https://github.com/renovate\[bot]) in [#&#8203;392](jdx/hk#392)
- update github artifact actions (major) by [@&#8203;renovate\[bot\]](https://github.com/renovate\[bot]) in [#&#8203;393](jdx/hk#393)
- update rust crate infer to 0.19 by [@&#8203;renovate\[bot\]](https://github.com/renovate\[bot]) in [#&#8203;418](jdx/hk#418)
- update jdx/mise-action digest to [`9dc7d5d`](jdx/hk@9dc7d5d) by [@&#8203;renovate\[bot\]](https://github.com/renovate\[bot]) in [#&#8203;417](jdx/hk#417)

##### New Contributors

- [@&#8203;scop](https://github.com/scop) made their first contribution in [#&#8203;410](jdx/hk#410)
- [@&#8203;arthurcogo](https://github.com/arthurcogo) made their first contribution in [#&#8203;390](jdx/hk#390)
- [@&#8203;minusfive](https://github.com/minusfive) made their first contribution in [#&#8203;388](jdx/hk#388)

</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:eyJjcmVhdGVkSW5WZXIiOiI0MS4xNzMuMSIsInVwZGF0ZWRJblZlciI6IjQxLjE3My4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiXX0=-->
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.

1 participant