Replies: 2 comments
|
The idea is useful, but I would name the option after its behavior rather than check_verbose. Verbose usually means �print more of the same output,� while this feature performs a second, file-scoped check. Something like check_on_failure or check_failed_files would make the contract clearer:
The option should be opt-in because not every check command accepts file paths, and some tools have expensive startup costs that would make a second pass worse. It should also define what happens when the file-list command succeeds but returns no paths, when paths are outside the repository, or when the file-scoped check returns a different status from the aggregate check. For large agentic workflows, the biggest win is probably a structured result internally: failed paths, diagnostics, and a compact human-readable rendering. That avoids forcing the user or an agent to parse a giant command line. A regression test with a 120,000-file fixture can verify that the output stays bounded while the original error details remain available. |
|
Implemented in PR #1123. It adds the opt-in check_failed_files setting, which uses check_diff or check_list_files to identify the affected paths and then runs check only on that focused set for full diagnostics. The implementation also bounds oversized fix suggestions and reapplies ARG_MAX batching before the focused command. Tests cover focused diagnostics, inconsistent exit statuses, validation, bounded suggestions, and large-file batching. This comment was generated by Codex. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This is just an idea I had for making
hk check --allmore useful on large repos, but it applies more generally to other development workflows.We use
hkon a repo with a lot of files (120,000+), and in particular, we tend to use linters that don't expose a cleancheck_list_files/check_diffinterface (i.e.ruff-check). Whenhkprocesses a chunk of files for a given step and the checker exits with a non-zero status / finds errors, and onlycheck+fixis provided,hkemits afixcommand that is quite long (since it doesn't know which file emitted the error). We can work around this to some degree by wrappingruff's output with a small script and emit only the unique files with violations, which neatly condenses the proposedfixcommand, but we lose the fidelity of error output as a result.My proposal is to add a new option for
Step(maybe call itcheck_verbose) that allowshkto run a file-scopedcheckcommand ifcheck_list_files/check_diffran and exited with a list of files that have problems.This is particularly important for agentic development flows (a long
fixcommand just wastes tokens for no good reason, and here, it would likely be looking at output from a failed CI run), but it's also a tangible improvement for humans who want to look athkoutput without using the LLM.All reactions