Skip to content

Add -Top parameter and tree consolidation logic#66

Merged
santisq merged 8 commits into
mainfrom
63-add-top-n-summarizationconsolidation-for-large-subtrees
May 2, 2026
Merged

Add -Top parameter and tree consolidation logic#66
santisq merged 8 commits into
mainfrom
63-add-top-n-summarizationconsolidation-for-large-subtrees

Conversation

@santisq

@santisq santisq commented May 1, 2026

Copy link
Copy Markdown
Owner

New Features

  • Added -Top parameter (alias -t) to Get-PSTree to limit the number of children displayed per directory.
    • Using -Top automatically enables -RecursiveSize and defaults -SortBy to Size when -SortBy is not bound.
    • Added validation logic to ensure -Top is only used with size-based sort modes (Size or DirectoriesFirstBySize), throwing a terminating error for incompatible combinations.
  • New TreeSummary node class to represent aggregated "overflow" items when -Top is used.
  • Added SummaryStyle property to TreeStyle.FileSystemStyle to allow customizable coloring for summary objects.

Changed

  • Refactored tree processing to separate Data Shaping (sorting, pruning, and truncation) from .Render(), improving consistency and performance during enumeration.
  • Updated and expanded documentation for Get-PSTree (especially the -Top parameter, TreeSummary output type, and usage examples).

@santisq santisq self-assigned this May 1, 2026
@santisq santisq added documentation Improvements or additions to documentation enhancement New feature or request labels May 1, 2026
@santisq santisq linked an issue May 1, 2026 that may be closed by this pull request
@codecov

codecov Bot commented May 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.46154% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 98.24%. Comparing base (5332472) to head (493ba79).
⚠️ Report is 9 commits behind head on main.

Files with missing lines Patch % Lines
src/PSTree/Extensions/ExceptionExtensions.cs 90.00% 1 Missing ⚠️
src/PSTree/Nodes/TreeBase.cs 95.45% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #66      +/-   ##
==========================================
+ Coverage   98.18%   98.24%   +0.06%     
==========================================
  Files          37       38       +1     
  Lines         825      913      +88     
  Branches      108      118      +10     
==========================================
+ Hits          810      897      +87     
- Misses          8        9       +1     
  Partials        7        7              
Flag Coverage Δ
PS-5.1 97.79% <98.46%> (+0.11%) ⬆️
PS-7_Linux 73.61% <89.92%> (+2.11%) ⬆️
PS-7_Windows 97.56% <98.44%> (+0.26%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 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.

@santisq
santisq merged commit 96ec9ad into main May 2, 2026
7 checks passed
@santisq
santisq deleted the 63-add-top-n-summarizationconsolidation-for-large-subtrees branch May 2, 2026 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Top-N summarization/consolidation for large subtrees

1 participant