PowerShell / PowerShell/PSScriptAnalyzer
Additional settings file for developement
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 2.2k
- Forks
- 414
- Avg merge
- 13h 1m
- Merged PRs (30d)
- 2
Description
Summary of the new feature
There is currently one PSScriptAnalyzerSettings.psd1 file shipped with the PSScriptAnalyzer but there are at least two use cases with a different requirement:
-
Design-time
During this phase (often done is VSCode or Visual Studio), any cutting-edge alert for a potential PowerShell pitfall is welcome. -
Continuous Integration
During this phase (e.g. in a CI/CD street), any change is supposed to passed the given tests.
Apparently, there is a (undocumented?) convention that our convention is to ship it opt-in via ConfigurableRule with Enable = false but that convention only satisfies the builder phase.
Proposed technical implementation details (optional)
Ship the PSScriptAnalyzer with an additional settings file that is focused on the development phase.
The "development" settings file might than be used as a default by e.g. VSCode (powershell.scriptAnalysis.settingsPath).
Caveats
- The settings file under VSCode "This setting may not work as expected currently!", see: https://github.com/PowerShell/vscode-powershell/issues/4653
- https://github.com/PowerShell/vscode-powershell/issues/5385? "Users keep getting bitten by the extension's effective defaults differing from Invoke-ScriptAnalyzer's defaults", I believe this isn't a feature but a bug, see: https://github.com/PowerShell/vscode-powershell/issues/5474
What is the latest version of PSScriptAnalyzer at the point of writing
1.25.0
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the shipped PSScriptAnalyzerSettings.psd1 and the VSCode powershell.scriptAnalysis.settingsPath setting mentioned in the issue. Compare the design-time and CI requirements, then determine the development-focused rules and how the additional file should be shipped. Done means a separate development settings file is available without changing the existing settings file.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell, vscode
- Domain
- developer-experience, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100