Repository navigation
ci: run PSScriptAnalyzer's two racing rules apart - #174
Merged
Merged
Conversation
… longer crashes now and then PSScriptAnalyzer 1.25.0 runs a file's rules in parallel. PSProvideCommentHelp and PSReservedCmdletChar read Export-ModuleMember's parameters through a runspace the other rules use at the same time, which now and then fails the whole call with a NullReferenceException or "more than one dynamic module in each dynamic assembly" (PowerShell/PSScriptAnalyzer#2229, open). build/Invoke-ScriptAnalysis.ps1 leaves out PSProvideCommentHelp (Information, which the check does not count) and runs PSReservedCmdletChar in a pass of its own; on a crash it writes the full exception with its stack. CI and AGENTS.md call the script instead of each holding the command. Fixes #168 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Owner
Author
|
The |
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.
Fixes #168
Invoke-ScriptAnalyzerin thepowershelljob crashes now and then. Main failed this way after #172 was merged, and #173 failed twice in a row. This pull request removes the cause instead of retrying.Cause
PSScriptAnalyzer 1.25.0 runs the rules for a file in parallel.
PSProvideCommentHelpandPSReservedCmdletCharboth read the parameters ofExport-ModuleMemberthrough a runspace that the other rules use at the same time. Every module file here callsExport-ModuleMember. Now and then one of the two rules gets aNullReferenceException, or the two collide with "You cannot have more than one dynamic module in each dynamic assembly". Both messages are in our failed runs. The analysis and the stacks are in PowerShell/PSScriptAnalyzer#2229 (open, no fixed release; 1.25.0 is the latest). The per-folder calls from #39 never removed this cause: the recent failures came from them.Change
build/Invoke-ScriptAnalysis.ps1runs the analyzer as CI does:PSProvideCommentHelpis left out. It reports Information only, which this check never counted.PSReservedCmdletChar(a Warning) runs in a pass of its own, with no other rule beside it. This is the workaround from #2229.Evidence
powershelljob three times on this pull request (results in a comment below).Write-Hostand fails, and it passes on the repository.Not changed
timeout-minutes: 15bounds that.🤖 Generated with Claude Code