Skip to content

fix(hooks): writeln!(stderr) not eprintln! in gate-no-rewrite deny path - #110

Merged
thehoff merged 1 commit into
developfrom
fix/clippy-print-stderr-gate
May 20, 2026
Merged

thehoff merged 1 commit into
developfrom
fix/clippy-print-stderr-gate

Conversation

@thehoff

@thehoff thehoff commented May 20, 2026

Copy link
Copy Markdown
Owner

Summary

Release-blocker fix found while auditing the merged tip after the #100 audit landed.

src/hooks/mod.rs carries #[deny(clippy::print_stdout, clippy::print_stderr)] so a stray print macro can't corrupt the hook protocol. The gate-wiring deny log (#106 follow-up) used eprintln! at hook_cmd.rs:487. Each audit PR's CI ran against an earlier develop, so this only surfaced as a clippy hard error once all 9 changesets were on the same tip.

Swapped to the file's established writeln!(io::stderr(), ...) pattern — identical to the read_stdin_limited error path a few lines down. Behaviourally identical.

Verification (on the merged develop tip)

  • cargo clippy --workspace --release — was exit 101, now exit 0, clean
  • cargo test --workspace — 2418 pass, 0 fail, 13 suites
  • cargo build --release — clean

Remaining clippy warnings (contains-vs-any, MSRV notes, doc indentation) pre-date the audit and are not release-gating.

Test plan

  • clippy clean
  • full test suite green
  • CI green (incl. Windows — the reason this is a PR not a direct commit)

🤖 Generated with Claude Code

@thehoff
thehoff merged commit 2bf56d9 into develop May 20, 2026
4 checks passed
@thehoff
thehoff deleted the fix/clippy-print-stderr-gate branch May 20, 2026 09:49
noogalabs pushed a commit to noogalabs/contextcrawler that referenced this pull request Jun 4, 2026
* feat(docker): add docker compose support with compact output

Add token-optimized output for docker compose commands:
- `docker compose ps`: compact service listing with status and ports
- `docker compose logs`: deduplicated log output via existing log engine
- `docker compose build`: summary with build time, services, and step count
- Unsupported compose subcommands pass through directly

Includes 11 tests (8 compose format tests + 3 for existing compact_ports).

Fixes thehoff#101

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: address PR thehoff#110 review — use --format for compose ps, fix bytes/chars bugs

- Switch format_compose_ps to parse structured --format tab output
  instead of fragile human-readable table (eliminates contains("Up")
  false positives and byte/char confusion)
- Fix find('[') byte offset used with chars().skip() in build parsing
- Use .next_back() instead of .last() on DoubleEndedIterator
- Consistent error handling with .context()? in run_compose_ps
- Strengthen test assertion for compose logs
- Add tests for no-ports and long-image-path cases

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: propagate exit codes on compose failures + remove Vec allocation

Address PR thehoff#110 review feedback from pszymkowiak:
- Check output.status.success() after .output() in run_compose_ps,
  run_compose_logs, and run_compose_build to prevent silent failures
  when Docker daemon is not running
- Replace .collect::<Vec<&str>>().len() with .count() in
  format_compose_build step counting to avoid unnecessary allocation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* docs: update version references to 0.20.1 after upstream rebase

Sync documentation version strings with Cargo.toml after rebasing
on upstream master. Fixes CI validate-docs check.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* chore: drop upstream workflow file from feature branch

This workflow was pulled in during rebase on upstream master.
Not part of the docker compose feature — let upstream manage it.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* chore: restore validate-docs workflow from upstream

Workflow was unintentionally removed while resolving a push
permission issue. Restored to match upstream master.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.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