Add -NoRecurse to Invoke-PSModuleAnalyzer - #17
Merged
Merged
Conversation
Callers that want to analyze a single directory's own scripts had no way to say so: Recurse was hardcoded on, so a wildcard like scripts/*.ps1 still pulled in a nested tests folder that needs different rules. Routing such a target through direct Invoke-ScriptAnalyzer instead is not a workaround, since that path hits the PSScriptAnalyzer 1.25.0 casing crash this module exists to avoid. - Add -NoRecurse, which flips the previously hardcoded Recurse argument - Thread Recurse into the casing workaround's Get-ChildItem so its per-file pass matches the scope - Document the wildcard form on SourceDirectory and add an example - Cover default-recursive vs -NoRecurse dispatch, wildcard scoping, and non-recursive casing - Bump the module to 3.1.0
SummarySummary
Coveragesrc/Private - 94.8%
src/Public - 88.8%
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Callers that want to analyze a single directory's own scripts had no way to say so:
Recursewashardcoded on, so a wildcard like
scripts/*.ps1still pulled in a nestedtestsfolder that needsdifferent rules. Routing such a target through direct
Invoke-ScriptAnalyzerinstead is not aworkaround, since that path hits the PSScriptAnalyzer 1.25.0 casing crash this module exists to
avoid.
-NoRecurse, which flips the previously hardcodedRecurseargumentRecurseinto the casing workaround''sGet-ChildItemso its per-file pass matches the scopeSourceDirectoryand add an example-NoRecursedispatch, wildcard scoping, and non-recursive casing71 tests pass locally.