Skip to content

fix(stdout): print the displayed item count with --show-item-count - #691

Open
LuisFigueroaG wants to merge 1 commit into
dundee:masterfrom
LuisFigueroaG:fix/stdout-displayed-item-count
Open

LuisFigueroaG wants to merge 1 commit into
dundee:masterfrom
LuisFigueroaG:fix/stdout-displayed-item-count

Conversation

@LuisFigueroaG

Copy link
Copy Markdown

With -n -C the item count depended on how the tree was scanned. The default scan printed 3 for a directory with three items and 0 for an empty one. --sequential, multiple paths, and -f input printed 4 and 1, because stdout printed the raw GetItemCount(), which includes the directory itself.

stdout now prints fs.DisplayedItemCount like the TUI and web UI (ADR 0001). The top-dir analyzer used by default in non-interactive mode now uses the same raw counts as Dir (a directory includes itself, files count 1), so the displayed value is the same for every analyzer.

Added a test that runs the same tree through the top-dir, parallel and sequential analyzers. make lint and go test ./... pass.

@codecov

codecov Bot commented Oct 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.73%. Comparing base (387cf50) to head (9650e5f).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #691   +/-   ##
=======================================
  Coverage   90.73%   90.73%           
=======================================
  Files          76       76           
  Lines        6843     6844    +1     
=======================================
+ Hits         6209     6210    +1     
  Misses        633      633           
  Partials        1        1           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@LuisFigueroaG

Copy link
Copy Markdown
Author

The lint failure isn't from this change: golangci-lint v2.13.2 can't load go1.27.2 export data (export data version 5 is greater than maximum supported version 4), and setup-go picks up go1.27.2 for 1.27.x now. It fails the same way on master locally, and other recent PRs hit it too, while v2.15.0 runs clean. Bumping the version in test.yml (and the Makefile) should fix it for all open PRs.

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