Skip to content

fix(filters): aggresivity batch fix#1895

Open
aeppling wants to merge 3 commits into
developfrom
fix/aggressive-filters-batch
Open

fix(filters): aggresivity batch fix#1895
aeppling wants to merge 3 commits into
developfrom
fix/aggressive-filters-batch

Conversation

@aeppling
Copy link
Copy Markdown
Contributor

Summary

  • Some filter were too aggressive, lower filtering & more accurate results

aeppling and others added 3 commits May 15, 2026 19:12
…iltering

Several filters dropped or rewrote information an agent needs, producing
output that was misleading rather than merely compressed. This fixes the
clear-cut cases surfaced by the TheDecipherist/rtk-test suite:

- ls: stop hiding the `.env` file (removed `.env`/`env` from NOISE_DIRS).
- git status: restore the explicit "HEAD detached at <sha>" line instead of
  the opaque "* HEAD (no branch)".
- log/docker logs: recognise CRITICAL/FATAL/ALERT/EMERGENCY/SEVERE (and
  NOTICE) as severities so those lines are no longer silently filtered;
  expose `log` as a `rtk pipe` filter and accept a positional filter name.
- wc: forward stdin to the child so `cat file | rtk wc` counts the pipe
  instead of reporting 0 (new RunOptions::inherit_stdin).
- jest/vitest: include skipped/pending test count in the compact summary.
- pytest: surface xfailed/xpassed counts and list XFAIL/XPASS entries with
  their reasons (adds `-rxX`).
- ruff/eslint: list individual violations with file:line:col, not just
  rule/file group counts.
- pnpm/npm list: render the actual package list instead of the false-positive
  "All packages up-to-date" when there's no upgrade info.
- git add: stay silent on a no-op instead of printing an ambiguous "ok".
- git stash: pass git's own message through instead of collapsing to "ok".
- docker ps: keep the Status column (health/restart info) and list
  stopped/exited containers; docker images: show all images with full names;
  docker compose ps: use `-a` so crashed services stay visible.

All 1870 unit tests pass; cargo fmt + clippy clean.
@aeppling aeppling changed the title fix: filter aggresivity batch fix fix(filters): aggresivity batch fix May 15, 2026
Copy link
Copy Markdown
Collaborator

@KuSh KuSh left a comment

Choose a reason for hiding this comment

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

Minor nitpicks and questions. Otherwise LGTM!

}
}
if running.len() > 20 {
rtk.push_str(&format!(" ... +{} more\n", running.len() - 20));
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nitpick, prefer utf8 character

Suggested change
rtk.push_str(&format!(" ... +{} more\n", running.len() - 20));
rtk.push_str(&format!(" +{} more\n", running.len() - 20));

if count > 15 {
rtk.push_str(&format!(" ... +{} more", count - 15));
if stopped.len() > 20 {
rtk.push_str(&format!(" ... +{} more\n", stopped.len() - 20));
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
rtk.push_str(&format!(" ... +{} more\n", stopped.len() - 20));
rtk.push_str(&format!(" +{} more\n", stopped.len() - 20));

if lines.len() > 15 {
rtk.push_str(&format!(" ... +{} more", lines.len() - 15));
if lines.len() > MAX_IMAGES {
rtk.push_str(&format!(" ... +{} more\n", lines.len() - MAX_IMAGES));
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
rtk.push_str(&format!(" ... +{} more\n", lines.len() - MAX_IMAGES));
rtk.push_str(&format!(" +{} more\n", lines.len() - MAX_IMAGES));

Comment thread src/cmds/git/git.rs

// Porcelain `-b` reduces a detached HEAD to "## HEAD (no branch)"; restore
// the explicit "HEAD detached at <sha>" from the plain status we captured.
if let Some(detached) = extract_detached_head(&raw_output) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Wouldn't it be better to check that before calling format_status_output and pass it detached instead of replacing the result afterward?

if pkgs.len() > 10 {
result.push_str(&format!(" ... +{} more\n", pkgs.len() - 10));
if pkgs.len() > MAX_PER_LETTER {
result.push_str(&format!(" ... +{} more\n", pkgs.len() - MAX_PER_LETTER));
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

while you're at it:

Suggested change
result.push_str(&format!(" ... +{} more\n", pkgs.len() - MAX_PER_LETTER));
result.push_str(&format!(" +{} more\n", pkgs.len() - MAX_PER_LETTER));

}
if diagnostics.len() > MAX_VIOLATIONS {
result.push_str(&format!(
" ... +{} more violations\n",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
" ... +{} more violations\n",
" +{} more violations\n",

Comment thread src/parser/formatter.rs
lines.push(format!(" {} {}{}", dep.name, dep.current_version, dev));
}
if self.dependencies.len() > 50 {
lines.push(format!(" ... +{} more", self.dependencies.len() - 50));
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
lines.push(format!(" ... +{} more", self.dependencies.len() - 50));
lines.push(format!(" +{} more", self.dependencies.len() - 50));

Comment thread src/parser/formatter.rs
Comment on lines +131 to +134
for dep in self.dependencies.iter().take(50) {
let dev = if dep.dev_dependency { " (dev)" } else { "" };
lines.push(format!(" {} {}{}", dep.name, dep.current_version, dev));
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Isn't there a hierarchy in deps? dep > dev dep > opt dep > ... shouldn't we first print dependencies, then if < 50 pick dev dependencies until we reach 50?

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.

2 participants