Skip to content

fix(builtins): stage gomod_tidy manifest updates - #1240

Merged
jdx merged 1 commit into
mainfrom
feat/discussion-1234-builtins
Aug 25, 2026
Merged

jdx merged 1 commit into
mainfrom
feat/discussion-1234-builtins

Conversation

@jdx

@jdx jdx commented Aug 25, 2026 •

Copy link
Copy Markdown
Owner

Summary

Related to #1234.

Test evidence

  • mise run pkl:gen
  • mise run build
  • mise run test:bats test/gomod_tidy_nested_module.bats
  • git diff --check

AI-assisted β€” Tool: Codex; model: unavailable/unavailable; version: unavailable.


Note

Low Risk
Builtin staging behavior only; no auth, runtime, or broad execution changes beyond ensuring Go module manifests are indexed after tidy.

Overview
gomod_tidy now declares stage = List("go.mod", "go.sum") so manifest updates from go mod tidy are added to the index when the step was triggered by a .go change (default staging only followed the step globs and could leave tidied go.mod/go.sum unstaged).

A new bats case in gomod_tidy_nested_module.bats covers a nested module: after staging only svc/main.go, hk fix --step gomod_tidy must leave both the Go file and svc/go.mod in the cached diff with no leftover unstaged manifest changes.

Reviewed by Cursor Bugbot for commit 0dc0d59. Bugbot is set up for automated code reviews on this repo. Configure here.

@coderabbitai

coderabbitai Bot commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. πŸŽ‰

ℹ️ Recent review info
βš™οΈ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: bb864186-5f89-4733-9a69-7e9d318e26e9

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 5d5a94d and 1428b37.

β›” Files ignored due to path filters (3)
  • pkl/builtins/gomod_tidy.pkl is excluded by !**/*.pkl
  • pkl/builtins/ls_lint.pkl is excluded by !**/*.pkl
  • pkl/builtins/shellcheck.pkl is excluded by !**/*.pkl
πŸ“’ Files selected for processing (3)
  • test/builtin_tool_stubs/ls-lint
  • test/gomod_tidy_nested_module.bats
  • test/shellcheck_fix.bats

Included review availability: Your plan provides up to 4 included reviews per hour; 1 remains after this review.


πŸ“ Walkthrough

Walkthrough

The changes add an ls-lint tool stub and integration tests for ShellCheck fixes and gomod_tidy behavior in nested Go modules.

Changes

Integration test coverage

Layer / File(s) Summary
ShellCheck fix validation
test/shellcheck_fix.bats, test/builtin_tool_stubs/ls-lint
The new Bats test configures Builtins.shellcheck, validates automatic backtick conversion, and checks failure handling for SC2034. The test environment includes the builtin tool stub path and an ls-lint Mise stub.
Nested gomod_tidy validation
test/gomod_tidy_nested_module.bats
The integration test verifies that gomod_tidy stages both nested module source changes and the updated go.mod file without an unstaged manifest diff.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: βšͺ Minimal Β· up to 1428b

This PR adds localized Go and shell linting behavior plus an ls-lint builtin; no actionable merge-blocking risk remains after normal checks and review.

Poem

A rabbit checks the staged rows,
ShellCheck trims the tangled toes.
Go modules tidy in their burrow,
Tool stubs guide each careful sparrow.
Clean diffs rest beneath the moon.

πŸš₯ Pre-merge checks | βœ… 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
βœ… Passed checks (4 passed)
Check name Status Explanation
Linked Issues check βœ… Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check βœ… Passed Check skipped because no linked issues were found for this pull request.
Description Check βœ… Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check βœ… Passed The title clearly describes the gomod_tidy manifest-staging change covered by the pull request. It does not mention the ShellCheck and ls_lint changes, but the title may focus on one significant p…
Full details: Docstring Coverage

Explanation

Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files. (1 skipped: 1 unsupported.)

Full details: Title check

Explanation

The title clearly describes the gomod_tidy manifest-staging change covered by the pull request. It does not mention the ShellCheck and ls_lint changes, but the title may focus on one significant part of the changeset.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❀️ Share

Comment @coderabbitai help to get the list of available commands.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 1428b37. Configure here.

Comment thread pkl/builtins/shellcheck.pkl Resolved
@greptile-apps

greptile-apps Bot commented Aug 25, 2026 •

Copy link
Copy Markdown

Greptile Summary

The PR updates gomod_tidy so manifest changes produced while fixing Go source are staged alongside the triggering files.

  • Adds workspace-relative staging patterns for go.mod and go.sum.
  • Adds a nested-module integration test verifying that the changed Go file and tidied manifest are staged.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
pkl/builtins/gomod_tidy.pkl Adds workspace-aware staging of Go module manifests after go mod tidy fixes.
test/gomod_tidy_nested_module.bats Verifies that a Go-source-triggered tidy in a nested module stages both the source file and updated manifest.

Reviews (4): Last reviewed commit: "fix(builtins): stage gomod_tidy manifest..." | Re-trigger Greptile

Comment thread pkl/builtins/shellcheck.pkl Resolved
@github-actions

github-actions Bot commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

Instruction counts

Nothing was compared, and so nothing was gated. No series appears on both sides: either the base has no measurements recorded, or the two were measured on different runner classes, which are deliberately not comparable β€” counts shift between machine types by more than a real regression does.

New, nothing to compare against: builtins on bamboo-v2-ubuntu24.04-x64-30vcpu-24gb-rust1.97.1, check on bamboo-v2-ubuntu24.04-x64-30vcpu-24gb-rust1.97.1, usage on bamboo-v2-ubuntu24.04-x64-30vcpu-24gb-rust1.97.1, validate on bamboo-v2-ubuntu24.04-x64-30vcpu-24gb-rust1.97.1

Only instruction counts gate. Wall clock is shown for context β€” on identical hardware it moves 4-20% run to run.

Measured by tak β€” instruction-counted CLI benchmarks, stored in this repository's git notes.

0dc0d59c746e vs 7d50fee00327 Β· measured on the runner, not pushed to the history.

@jdx
jdx force-pushed the feat/discussion-1234-builtins branch from 3d6980b to ad77c5a Compare August 25, 2026 15:10
@jdx
jdx force-pushed the feat/discussion-1234-builtins branch from ad77c5a to 0dc0d59 Compare August 25, 2026 15:36
@jdx jdx changed the title feat(builtins): improve Go and shell linting support fix(builtins): stage gomod_tidy manifest updates Aug 25, 2026
@jdx
jdx merged commit 2b90a06 into main Aug 25, 2026
22 checks passed
@jdx
jdx deleted the feat/discussion-1234-builtins branch August 25, 2026 15:54
@jdx jdx mentioned this pull request Aug 25, 2026
jdx added a commit that referenced this pull request Aug 30, 2026
### πŸš€ Features

- **(builtins)** add go_fix linter by
[@sahidvelji](https://github.com/sahidvelji) in
[#1224](#1224)
- **(builtins)** add ls_lint linter by
[@sahidvelji](https://github.com/sahidvelji) in
[#1238](#1238)
- **(builtins)** add golangci_lint_fmt formatter by
[@sahidvelji](https://github.com/sahidvelji) in
[#1244](#1244)
- **(builtins)** add shellcheck fix via check_diff by
[@sahidvelji](https://github.com/sahidvelji) in
[#1237](#1237)
- **(pkl)** embed the matching-version pkl package by
[@sahidvelji](https://github.com/sahidvelji) in
[#1218](#1218)
- **(step)** render `dir` through tera by
[@sahidvelji](https://github.com/sahidvelji) in
[#1219](#1219)
- **(step)** recheck applied diffs by [@jdx](https://github.com/jdx) in
[#1243](#1243)
- **(step)** allow configured command failures by
[@jdx](https://github.com/jdx) in
[#1291](#1291)

### πŸ› Bug Fixes

- **(builtins)** repair Go linters that report success on bad code by
[@sahidvelji](https://github.com/sahidvelji) in
[#1225](#1225)
- **(builtins)** broaden gomod_tidy glob to run tidy on .go changes by
[@sahidvelji](https://github.com/sahidvelji) in
[#1236](#1236)
- **(builtins)** stage gomod_tidy manifest updates by
[@jdx](https://github.com/jdx) in
[#1240](#1240)
- **(builtins)** recheck partial diff fixes by
[@jdx](https://github.com/jdx) in
[#1245](#1245)
- **(builtins)** correct gitleaks scan modes by
[@jdx](https://github.com/jdx) in
[#1248](#1248)
- **(stash)** skip empty pathspec stashes by
[@jdx](https://github.com/jdx) in
[#1283](#1283)
- **(step)** resolve Windows command shims by
[@jdx](https://github.com/jdx) in
[#1221](#1221)
- **(step)** relativize workspace paths to step directory by
[@jdx](https://github.com/jdx) in
[#1242](#1242)

### πŸ“š Documentation

- clarify subproject monorepo setup by [@jdx](https://github.com/jdx) in
[#1239](#1239)
- improve onboarding and navigation by [@jdx](https://github.com/jdx) in
[#1247](#1247)
- disable code ligatures by [@jdx](https://github.com/jdx) in
[#1264](#1264)
- publish llms.txt index by [@jdx](https://github.com/jdx) in
[#1272](#1272)

### πŸ›‘οΈ Security

- add sponsor logos to readme by [@jdx](https://github.com/jdx) in
[#1250](#1250)

### πŸ” Other Changes

- **(ci)** adopt mbx for Rust builds by [@jdx](https://github.com/jdx)
in [#1229](#1229)
- **(ci)** restrict trusted mbx runs to jdx by
[@jdx](https://github.com/jdx) in
[#1254](#1254)
- **(ci)** isolate mbx OIDC permissions by
[@jdx](https://github.com/jdx) in
[#1258](#1258)
- **(ci)** compare mbx with rust-cache by [@jdx](https://github.com/jdx)
in [#1267](#1267)
- **(ci)** adopt mbx 0.5.4 by [@jdx](https://github.com/jdx) in
[#1279](#1279)
- **(ci)** pin mr-boxington-action v1.0.1 by
[@jdx](https://github.com/jdx) in
[#1280](#1280)
- **(ci)** use default Rust for cache benchmark by
[@jdx](https://github.com/jdx) in
[#1284](#1284)
- **(ci)** bump mr-boxington action by [@jdx](https://github.com/jdx) in
[#1282](#1282)
- **(ci)** use server cache for dispatched benchmarks by
[@jdx](https://github.com/jdx) in
[#1285](#1285)
- **(ci)** adopt mbx 0.7.0 by [@jdx](https://github.com/jdx) in
[#1286](#1286)
- **(sponsors)** replace 37signals with omacom foundation by
[@jdx](https://github.com/jdx) in
[#1249](#1249)
- generate release notes before publishing by
[@jdx](https://github.com/jdx) in
[#1227](#1227)
- automate generated cli versions by [@jdx](https://github.com/jdx) in
[#1252](#1252)
- seed mbx cache for fork PRs by [@jdx](https://github.com/jdx) in
[#1262](#1262)
- notarize the macOS release binary by [@jdx](https://github.com/jdx) in
[#1266](#1266)
- benchmark mbx against rust-cache on Linux by
[@jdx](https://github.com/jdx) in
[#1275](#1275)
- remove pinned rust toolchain by [@jdx](https://github.com/jdx) in
[#1235](#1235)
- back mbx with the GitHub Actions cache alone by
[@jdx](https://github.com/jdx) in
[#1287](#1287)

### πŸ“¦οΈ Dependency Updates

- update rust crate pklr to v1.5.0 by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#1222](#1222)
- lock file maintenance by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#1226](#1226)
- bump usage to 6.4.0 by [@jdx](https://github.com/jdx) in
[#1228](#1228)
- update anthropics/claude-code-action action to v1.0.194 by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#1230](#1230)
- update jdx/mise-action action to v4.2.5 by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#1231](#1231)
- update rust crate demand to v2.1.0 by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#1241](#1241)
- update anthropics/claude-code-action action to v1.0.195 by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#1251](#1251)
- update rust crate pklr to v1.5.1 by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#1260](#1260)
- bump usage to 6.4.1 by [@jdx](https://github.com/jdx) in
[#1273](#1273)
- bump tak and mbx by [@jdx](https://github.com/jdx) in
[#1274](#1274)
- remove rust toolchain pins by [@jdx](https://github.com/jdx) in
[#1276](#1276)

### New Contributors

- @sahidvelji made their first contribution in
[#1237](#1237)

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Mechanical version and documentation URL updates with no runtime code
changes in the diff.
> 
> **Overview**
> **Cuts release v1.57.0** by bumping the `hk` crate and CLI metadata
from **1.56.1** to **1.57.0** (`Cargo.toml`, `Cargo.lock`,
`hk.usage.kdl`, generated CLI docs).
> 
> Adds the **[1.57.0] CHANGELOG** entry (features, fixes, CI/release
work, and dependency updates since 1.56.1) and updates every **Pkl
`amends` / `import` package URL** in README, docs, examples, and
`hk-example.pkl` to point at the new GitHub release artifacts.
> 
> No application logic changes in this diff; it packages already-merged
work. Notable themes called out in the new changelog include new
builtins (`go_fix`, `ls_lint`, `golangci_lint_fmt`, shellcheck fix),
step-engine improvements (Tera `dir`, diff recheck, optional command
failures), embedded matching-version Pkl, and assorted
builtin/stash/Windows path fixes.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
57fec76. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

Co-authored-by: mise-en-dev <123107610+mise-en-dev@users.noreply.github.com>
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