Skip to content

Comments

feat: suppress check output_summary when fixer runs with check_first#315

Merged
jdx merged 4 commits intomainfrom
suppress-check-output-when-fixer-ran
Sep 29, 2025
Merged

feat: suppress check output_summary when fixer runs with check_first#315
jdx merged 4 commits intomainfrom
suppress-check-output-when-fixer-ran

Conversation

@jdx
Copy link
Owner

@jdx jdx commented Sep 29, 2025

Summary

  • When check_first is enabled and a check fails followed by a fixer run, only show the fixer output in the summary
  • This reduces noise in the output summary by avoiding redundant check output when the fix has already been applied
  • The check output still appears in the real-time progress output for debugging, but not in the final summary

Problem

When using check_first, if a check fails and then a fixer runs successfully, the output summary would show both:

  1. The check failure output
  2. The fixer success output

This is redundant since the fixer has already addressed the issue the check found.

Solution

Modified the output_summary logic in step.rs to detect when we're running a check as part of check_first that will be followed by a fixer. In this case, we skip appending the check output to the summary.

Test plan

  • Added new test file test/output_summary_check_first.bats with three test cases:
    • When check fails and fixer runs: only fixer output appears in summary
    • When check passes: only check output appears in summary (fixer doesn't run)
    • Normal operation without check_first continues to work
  • All existing tests pass
  • Manual testing confirms the behavior

🤖 Generated with Claude Code


Note

Skip appending failed check output to the end-of-run summary when using check_first and a fixer runs; add tests covering check, check_list_files, and check_diff cases.

  • Behavior change (src/step.rs):
    • Skip saving check output to summary when check_first check fails and a fixer will run; still show check output if it passes (no fix runs).
    • Add save_output_summary(...) helper and use it for both success and failure paths.
  • Tests:
    • Add test/output_summary_check_first.bats covering:
      • Suppression when fixer runs after failed check (including check_list_files and check_diff).
      • Showing check output when it passes (no fix).
      • Normal behavior without check_first.

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

jdx added 3 commits September 29, 2025 12:03
When check_first is enabled and a check fails followed by a fixer run,
only show the fixer output in the summary, not the redundant check output.
This reduces noise when both check and fix are executed for the same step.

- Modified step.rs to skip output_summary for check_first checks that fail
- Added comprehensive tests in output_summary_check_first.bats
- Works correctly when check passes (shows check output) or fails (shows only fixer output)
… runs

- Extended the check_first output suppression to handle all check types
- Added output suppression for successful check runs (not just failures)
- Added tests for check_list_files and check_diff scenarios
- All three check types (check, check_list_files, check_diff) now have
  their output suppressed when followed by a fixer
- Extracted duplicated output_summary handling into save_output_summary()
- Reduces code duplication between success and error paths
- Makes the logic easier to maintain and understand
cursor[bot]

This comment was marked as outdated.

The previous implementation was too broad - it suppressed output for ALL
check_first checks. This fix ensures:
- Failed check_first checks: output suppressed (fixer will run and show output)
- Passed check_first checks: output shown (no fixer runs, so we need to see check output)

This gives users the right feedback - they see check output when checks pass,
and fixer output when checks fail and get fixed.
@jdx jdx merged commit 0205f33 into main Sep 29, 2025
6 checks passed
@jdx jdx deleted the suppress-check-output-when-fixer-ran branch September 29, 2025 21:10
@jdx jdx mentioned this pull request Sep 29, 2025
jdx added a commit that referenced this pull request Oct 2, 2025
## [1.16.0](https://github.com/jdx/hk/compare/v1.15.7..v1.16.0) -
2025-10-02

### 🚀 Features

- add HK_STAGE setting to control automatic staging of fixed files by
[@jdx](https://github.com/jdx) in
[#313](#313)
- suppress check output_summary when fixer runs with check_first by
[@jdx](https://github.com/jdx) in
[#315](#315)

### 🐛 Bug Fixes

- --slow flag now properly enables slow profile by
[@jdx](https://github.com/jdx) in
[#317](#317)

### 📚 Documentation

- Update getting_started.md by [@jdx](https://github.com/jdx) in
[a8c1a35](a8c1a35)

### 🔍 Other Changes

- Update getting_started.md by [@jdx](https://github.com/jdx) in
[58c0564](58c0564)

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Release v1.16.0 with new staging control, output suppression tweak, a
--slow flag fix, docs update, and version/dependency bumps.
> 
> - **Release `1.16.0`**
> - **Features**: add `HK_STAGE` setting; suppress `check`
output_summary when fixer runs with `check_first`.
>   - **Bug Fix**: `--slow` flag now enables the `slow` profile.
>   - **Docs**: update `getting_started.md`.
> - **Versioning**: bump crate to `1.16.0` in `Cargo.toml`; update CLI
version in `docs/cli/commands.json`, `docs/cli/index.md`, and
`hk.usage.kdl`.
> - **Dependencies**: update crates in `Cargo.lock` (e.g., `anstyle`,
`deflate64`, `owo-colors`, `quote`, `rustls-webpki`, `typenum`,
`usage-lib`, `zeroize`).
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
bffe2fc. 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 Oct 10, 2025
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [hk](https://github.com/jdx/hk) | minor | `1.15.7` -> `1.18.3` |

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.18.3`](https://github.com/jdx/hk/blob/HEAD/CHANGELOG.md#1183---2025-10-07)

[Compare Source](jdx/hk@v1.18.2...v1.18.3)

##### 🐛 Bug Fixes

- stash untracked files during partial stashes when HK\_STASH\_UNTRACKED=true by [@&#8203;jdx](https://github.com/jdx) in [#&#8203;357](jdx/hk#357)

### [`v1.18.2`](https://github.com/jdx/hk/blob/HEAD/CHANGELOG.md#1182---2025-10-06)

[Compare Source](jdx/hk@v1.18.1...v1.18.2)

##### 🐛 Bug Fixes

- stage directive to include untracked files matching globs by [@&#8203;jdx](https://github.com/jdx) in [#&#8203;355](jdx/hk#355)

### [`v1.18.1`](https://github.com/jdx/hk/blob/HEAD/CHANGELOG.md#1181---2025-10-05)

[Compare Source](jdx/hk@v1.18.0...v1.18.1)

##### 🐛 Bug Fixes

- prevent race condition when files are deleted between collection and execution by [@&#8203;jdx](https://github.com/jdx) in [#&#8203;353](jdx/hk#353)

### [`v1.18.0`](https://github.com/jdx/hk/blob/HEAD/CHANGELOG.md#1180---2025-10-05)

[Compare Source](jdx/hk@v1.16.0...v1.18.0)

##### 🚀 Features

- add fix-smart-quotes util by [@&#8203;joonas](https://github.com/joonas) in [#&#8203;348](jdx/hk#348)

##### 🐛 Bug Fixes

- add Windows support by guarding Unix-specific file permission APIs by [@&#8203;jdx](https://github.com/jdx) in [#&#8203;349](jdx/hk#349)
- handle missing files in update-version script by [@&#8203;jdx](https://github.com/jdx) in [#&#8203;350](jdx/hk#350)
- rewrite update-version script to avoid pipefail issues by [@&#8203;jdx](https://github.com/jdx) in [211b1ac](jdx/hk@211b1ac)
- run render before update-version in release script by [@&#8203;jdx](https://github.com/jdx) in [35d2df3](jdx/hk@35d2df3)
- use \[0-9] instead of \d in ripgrep pattern for better compatibility by [@&#8203;jdx](https://github.com/jdx) in [cf8ebb0](jdx/hk@cf8ebb0)
- explicitly specify search path for ripgrep in update-version script by [@&#8203;jdx](https://github.com/jdx) in [5666f96](jdx/hk@5666f96)

##### 🔍 Other Changes

- add diagnostic output to update-version script by [@&#8203;jdx](https://github.com/jdx) in [aaeea63](jdx/hk@aaeea63)
- add more file existence checks by [@&#8203;jdx](https://github.com/jdx) in [cbace40](jdx/hk@cbace40)
- test rg pattern matching in CI environment by [@&#8203;jdx](https://github.com/jdx) in [a52ea46](jdx/hk@a52ea46)

##### New Contributors

- [@&#8203;joonas](https://github.com/joonas) made their first contribution in [#&#8203;348](jdx/hk#348)

### [`v1.16.0`](https://github.com/jdx/hk/blob/HEAD/CHANGELOG.md#1160---2025-10-02)

[Compare Source](jdx/hk@v1.15.7...v1.16.0)

##### 🚀 Features

- add HK\_STAGE setting to control automatic staging of fixed files by [@&#8203;jdx](https://github.com/jdx) in [#&#8203;313](jdx/hk#313)
- suppress check output\_summary when fixer runs with check\_first by [@&#8203;jdx](https://github.com/jdx) in [#&#8203;315](jdx/hk#315)

##### 🐛 Bug Fixes

- \--slow flag now properly enables slow profile by [@&#8203;jdx](https://github.com/jdx) in [#&#8203;317](jdx/hk#317)

##### 📚 Documentation

- Update getting\_started.md by [@&#8203;jdx](https://github.com/jdx) in [a8c1a35](jdx/hk@a8c1a35)

##### 🔍 Other Changes

- Update getting\_started.md by [@&#8203;jdx](https://github.com/jdx) in [58c0564](jdx/hk@58c0564)

</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:eyJjcmVhdGVkSW5WZXIiOiI0MS4xMzIuNSIsInVwZGF0ZWRJblZlciI6IjQxLjEzOC4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiXX0=-->
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