Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improves how -Include works #39

Merged
merged 19 commits into from
Jan 19, 2025
Merged

Improves how -Include works #39

merged 19 commits into from
Jan 19, 2025

Conversation

santisq
Copy link
Owner

@santisq santisq commented Jan 16, 2025

Before this PR, -Include would only target files and not directories. It would also display folders where no file matched the pattern, for example:

PS ..\pwsh> pstree -include *.ps1

   Source: C:\Users\User\Documents\pwsh

Mode            Length Hierarchy
----            ------ ---------
da---        133.46 KB pwsh
-a---        487.00  B ├── test1.ps1
-a---          7.57 KB ├── test2.ps1
d----         12.30 KB ├── testcs
d----         25.17 KB │   ├── obj
d----          0.00  B │   │   └── Debug
d----          0.00  B │   └── bin
d----          0.00  B │       └── Debug
d----        386.00  B ├── consoleapp
d----          5.00 KB │   ├── obj
d----          0.00  B │   │   └── Debug
d----          0.00  B │   └── bin
d----          0.00  B │       └── Debug
d----          1.67 KB └── .vscode

With the new version, -Include now properly can target folders and also exclude sub-trees where no leaf matched the include pattern:

PS ..\pwsh> pstree -include *.ps1

   Source: C:\Users\User\Documents\pwsh

Mode            Length Hierarchy
----            ------ ---------
da---        133.46 KB pwsh
-a---        487.00  B ├── test1.ps1
-a---          7.57 KB └── test2.ps1

@santisq santisq linked an issue Jan 16, 2025 that may be closed by this pull request
@santisq santisq self-assigned this Jan 16, 2025
@santisq santisq added documentation Improvements or additions to documentation enhancement New feature or request labels Jan 16, 2025
Copy link

codecov bot commented Jan 16, 2025

Codecov Report

Attention: Patch coverage is 99.58159% with 1 line in your changes missing coverage. Please review.

Project coverage is 97.63%. Comparing base (6c617ee) to head (3567b8b).
Report is 20 commits behind head on main.

Files with missing lines Patch % Lines
src/PSTree/PSTreeFile.cs 94.73% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #39      +/-   ##
==========================================
+ Coverage   96.83%   97.63%   +0.79%     
==========================================
  Files          16       16              
  Lines         569      591      +22     
  Branches       60       67       +7     
==========================================
+ Hits          551      577      +26     
+ Misses         17       12       -5     
- Partials        1        2       +1     
Flag Coverage Δ
PS-5.1 97.63% <99.58%> (+1.32%) ⬆️
PS-7_Linux 97.29% <99.58%> (+1.33%) ⬆️
PS-7_Windows 97.63% <99.58%> (+1.32%) ⬆️

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.

@santisq santisq merged commit 21dcdef into main Jan 19, 2025
7 checks passed
@santisq santisq deleted the 38-improve-how-include-works branch January 19, 2025 23:01
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.

Improve how -Include works
1 participant