PowerShell / PowerShell/vscode-powershell
Add option to specify paths for ScriptAnalyzer-evaluation
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 1.9k
- Forks
- 548
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
Summary of the new feature
This extension should include a setting to specify which paths to run Script Analysis against. Currently the extension reads the PSScriptAnalyzer.psd1-file in workspace root (if not modified) and executes PSSA against all files recursively.
Let's say you only want to run the rules against src/* and tool/*. AFAIK this can't be configured in the extension nor PSScriptAnalyzer.psd1, which can result in many unnecessary problems and warnings in folders without the same requirements to follow best practices.
Proposed technical implementation details (optional)
Invoke-ScriptAnalyzer solves this problem by requiring a Path or ScriptDefinition parameter. As the extension uses the latter option, then the logic and paths-setting would have to be part of the Script Analysis-part of vscode-powershell + PowerShellEditorServices.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit, die Script Analysis-Logik in vscode-powershell und PowerShellEditorServices nachzuverfolgen, und konzentriere dich darauf, wie Invoke-ScriptAnalyzer derzeit seine ScriptDefinition erhält und wie PSScriptAnalyzer.psd1 gelesen wird. Lege fest, wo eine paths-Einstellung hingehört, und überprüfe anschließend, dass Pfade wie src/* und tool/* die Analyse einschränken, während nicht zugehörige Workspace-Dateien ausgeschlossen werden.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- powershell, typescript, vscode
- Bereich
- developer-experience, devtools, tooling
- Issue-Typ
- Feature
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100