justinmclean opened a new issue, #406:
URL: https://github.com/apache/airflow-steward/issues/406
## Summary
`tools/dev/agent-pre-commit.sh` tries to print the names of the prek
hooks that failed at the bottom of its output, but a `sed` pipeline
collapses each matched line to the literal ` - FAILED`, so the
"Failed hooks:" summary never includes any hook names. Fix the
extraction so each failed hook's name appears in the summary.
## Background
When prek (the pre-commit runner this repo uses) reports failures, the
wrapper script tries to print a "Failed hooks:" section at the very end
so the contributor sees which hooks need attention without re-scrolling
the full output. The current pipeline collapses every matched line to
the literal string ` - FAILED`, then runs a second `sed` whose pattern
does not match, so the hook name never makes it into the summary. The
script's other behaviour (exit code, full prek output relay) is fine;
only the trailing summary is broken. The script has no test coverage,
which is why the regression has not been caught.
## Where to look
- `tools/dev/agent-pre-commit.sh` — lines 79-85, the `failed_hooks=$(...)`
pipeline. Each failed line in prek's color output ends with
`\e[41mFailed\e[49m`; the hook name is the dotted-leader text
immediately before it (for example
`typos............................Failed`).
## Acceptance criteria
- [ ] After a deliberate prek failure (for example a `typos` violation),
running `tools/dev/agent-pre-commit.sh` prints a "Failed hooks:"
section that lists each failed hook by name (` - typos`,
` - ruff`, ...), not a generic ` - FAILED` line.
- [ ] The script still exits 1 on failure and 0 on success.
- [ ] No new external dependencies; pure `bash` / `grep` / `sed` / `awk`.
## Estimated effort
~1 hours for someone new to the codebase.
## Getting started
- [Your first
contribution](https://github.com/apache/airflow-steward/blob/main/CONTRIBUTING.md#your-first-contribution)
---
_This issue was drafted with the help of an AI-assisted tool and reviewed by
an airflow-steward maintainer before posting._
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]