Commit 9c04a44
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>1 parent 940024a commit 9c04a44
14 files changed
Lines changed: 2460 additions & 3 deletions
File tree
- Engine
- Commands
- Generic
- Tests/Engine
- docs/Cmdlets
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
117 | 121 | | |
118 | | - | |
| 122 | + | |
119 | 123 | | |
120 | 124 | | |
121 | 125 | | |
| |||
Large diffs are not rendered by default.
0 commit comments