-
Notifications
You must be signed in to change notification settings - Fork 411
Comparing changes
Open a pull request
base repository: PowerShell/PSScriptAnalyzer
base: 1.25.0
head repository: PowerShell/PSScriptAnalyzer
compare: main
- 6 commits
- 30 files changed
- 6 contributors
Commits on Mar 20, 2026
-
Configuration menu - View commit details
-
Copy full SHA for 9b55ac2 - Browse repository at this point
Copy the full SHA 9b55ac2View commit details
Commits on Apr 2, 2026
-
Sync docs edits from docs repo (#2170)
* Sync docs edits from docs repo * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Configuration menu - View commit details
-
Copy full SHA for a143b9f - Browse repository at this point
Copy the full SHA a143b9fView commit details
Commits on May 4, 2026
-
Improve pipeline indentation handling in UseConsistentIndentation rule (
#2173) * Improve pipeline indentation handling in UseConsistentIndentation rule * Fix over-indentation when multiple openers appear on the same line
Configuration menu - View commit details
-
Copy full SHA for d97ddd4 - Browse repository at this point
Copy the full SHA d97ddd4View commit details
Commits on May 7, 2026
-
Prevent duplicate rule ID suppression errors in
-Fixand DSC scenar……ios (#2181) * Enhance suppression error handling in ScriptAnalyzer and add tests for unapplied suppression errors * Skip new -Fix suppression test under Library Usage harness The `Library Usage` describe block in `LibraryUsage.tests.ps1` (only active on Windows PowerShell 5.1, since it's gated `-Skip:$IsCoreCLR`) re-runs `RuleSuppression.tests.ps1` against a hand-rolled `Invoke-ScriptAnalyzer` wrapper that drives the analyzer as a .NET library. That wrapper plugs in `PesterTestOutputWriter`, whose `WriteError` is intentionally a no-op: public void WriteError(ErrorRecord error) { // We don't write errors to avoid misleading // error messages in test output } So the unapplied-suppression `ErrorRecord` we now emit during the final `-Fix` pass never reaches `-ErrorVariable`, and `$fixErr | Should -HaveCount 1` fails with "Expected a collection with size 1, but got an empty collection". The behaviour itself is correct - the assertion is just unobservable through this test harness. Mark the new `It` block `-Skip:$testingLibraryUsage`, matching the existing pattern already used by the `Bad Rule Suppression` and `External Rule Suppression` contexts in the same file for the same reason. The regular pwsh and WinPS runs of `RuleSuppression.tests.ps1` (which `[+]` in the failing CI log) continue to exercise the assertion. The new `UseDSCResourceFunctions.tests.ps1` test isn't dot-sourced by `LibraryUsage.tests.ps1`, so it doesn't need the same guard. Drafted by Copilot (Claude Opus 4.7). * Add copilot review suggestions --------- Co-authored-by: Andy Jordan <2226434+andyleejordan@users.noreply.github.com>
Configuration menu - View commit details
-
Copy full SHA for 940024a - Browse repository at this point
Copy the full SHA 940024aView commit details -
Settings file creation and validation (#2176)
* Add RuleOptionInfo class and update RuleInfo to include options for configurable rules * Add Test and New Cmdlets for PSScriptAnalyzer Settings Management - Implemented `New-ScriptAnalyzerSettingsFile` cmdlet to create a new PSScriptAnalyzer settings file, with options for presets and overwriting existing files. - Added `Test-ScriptAnalyzerSettingsFile` cmdlet to validate settings files, checking for parseability, rule existence, and valid options. - Created comprehensive tests for both cmdlets to ensure functionality and error handling. - Updated module manifest to export the new cmdlets. - Added documentation for both cmdlets, including usage examples and parameter descriptions. - Enhanced error messages in the strings resource file for better clarity during validation failures. * Enhance ScriptAnalyzer settings file validation and documentation - Update Helper.cs to return null for empty output paths instead of an empty array. - Add new error message for invalid option types in Strings.resx. - Extend tests for New-ScriptAnalyzerSettingsFile to check for new keys: CustomRulePath, IncludeDefaultRules, and RecurseCustomRulePath. - Modify Test-ScriptAnalyzerSettingsFile tests to validate output and error handling for various scenarios, including type mismatches and invalid values. - Improve documentation for New-ScriptAnalyzerSettingsFile and Test-ScriptAnalyzerSettingsFile to clarify behavior and parameters, including handling of custom rules and output format. * Apply docs suggestions from Sean's review Co-authored-by: Sean Wheeler <sean.wheeler@microsoft.com> * Add Copilot review suggestions --------- Co-authored-by: Sean Wheeler <sean.wheeler@microsoft.com>
Configuration menu - View commit details
-
Copy full SHA for 9c04a44 - Browse repository at this point
Copy the full SHA 9c04a44View commit details
Commits on May 15, 2026
-
Add new MissingTryBlock rule (#2179)
* #2098 Add new MissingTryBlock rule * Changed severity level of MissingTryBlock rule from Error to Warning in the rule definition and resolved copy-pasta in the rule description. Co-authored-by: Copilot <copilot@github.com> * Updated tests for MissingTryBlock rule to reflect severity change from Error to Warning. * Update Rules/MissingTryBlock.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Grammar: “which is likely a mistake and result in … error” is ungrammatical. * Update Rules/Strings.resx Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update Rules/MissingTryBlock.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * minor but worthwhile * Update docs/Rules/MissingTryBlock.md Co-authored-by: Sean Wheeler <sean.wheeler@microsoft.com> * Applied feedback from @andrewconnell to add a note about the rule not being enabled by default, and to add a note about potential false positives with functions named "catch" or "finally". Also added a test context for when the rule is disabled. Updated the rule implementation to inherit from ConfigurableRule and set Enable to false in the constructor. Updated the AnalyzeScript method to be an override, and added overrides for GetCommonName, GetDescription, GetName, GetSeverity, and GetSourceName. * Update docs/Rules/MissingTryBlock.md Co-authored-by: Liam Peters <liamjpeters@gmail.com> * Update Tests/Rules/MissingTryBlock.tests.ps1 Co-authored-by: Liam Peters <liamjpeters@gmail.com> * Update Rules/MissingTryBlock.cs Co-authored-by: Liam Peters <liamjpeters@gmail.com> * Update Rules/MissingTryBlock.cs Co-authored-by: Liam Peters <liamjpeters@gmail.com> --------- Co-authored-by: Copilot <copilot@github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Sean Wheeler <sean.wheeler@microsoft.com> Co-authored-by: Liam Peters <liamjpeters@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 97f30d6 - Browse repository at this point
Copy the full SHA 97f30d6View commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff 1.25.0...main