Added dry-run, tree view, and global catignore support for better dev… - #3
Conversation
…elopment experience.
Review Summary by QodoAdd dry-run, tree view, and global catignore support
WalkthroughsDescription• Added -WhatIf switch for dry-run mode to preview bundled files • Added -IncludeTree switch to display directory tree structure • Implemented global catignore support via ~/.catignore file • Enhanced catignore to merge global and local patterns with deduplication • Added environment variable override for catignore path in testing • Added verbose logging for file processing operations Diagramflowchart LR
A["User Parameters"] -->|WhatIf| B["Dry-run Mode"]
A -->|IncludeTree| C["Directory Tree Output"]
A -->|CatIgnore| D["Pattern Matching"]
E["Global ~/.catignore"] -->|Merge| D
F["Local catignore"] -->|Merge| D
G["Environment Variable"] -->|Override| D
D -->|Filter| H["File List"]
B -->|Preview| H
C -->|Include| I["Final Output"]
H -->|Process| I
File Changes1. src/PowerCat/PowerCat.psm1
|
Code Review by Qodo
1.
|
There was a problem hiding this comment.
Code Review
This pull request enhances the PowerCat module by introducing -WhatIf and -IncludeTree switches, adding verbose logging, and improving the .catignore logic to support global and environment-variable-based ignore files. The review feedback identifies redundant path calculations, suggests using Write-Host for dry-run output to avoid polluting the success stream, and points out that the directory tree generation should respect the user's recursion preference.
| Write-Output "Dry run: The following files would be bundled:" | ||
| foreach ($file in $Files) { | ||
| Write-Output $file.FullName | ||
| } |
There was a problem hiding this comment.
Using Write-Output for dry-run status messages sends them to the success stream. This can pollute the output if the function is used in a pipeline or if the result is captured in a variable. It is better to use Write-Host or Write-Information for these messages so they don't pollute the data output.
Write-Host "Dry run: The following files would be bundled:"
foreach ($file in $Files) {
Write-Host $file.FullName
}
…elopment experience.