Add creation and validation of ScriptAnalyzer settings files
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 52/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Tranquilla
- Stack tecnologico
- powershell, typescript, vscode
- Ambito
- developer-experience, tooling
Direzione di ricerca
Esamina l'integrazione esistente di Invoke-ScriptAnalyzer e i punti di ingresso delle azioni codice/UI dell'estensione, quindi traccia il modo in cui vengono gestiti un editor attivo e le cartelle dell'area di lavoro. La funzionalità è completata quando gli utenti possono creare PSScriptAnalyzerSettings.psd1 e ricevere diagnostica da Test-ScriptAnalyzerSettingsFile quando quel file è aperto.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Prerequisites
- I have written a descriptive issue title.
- I have searched all issues to ensure it has not already been reported.
Summary
👋
As a module developer, I want to be able to add a ScriptAnalyzer settings file to my project easily, so it's stored alongside my code for consistency.
Something akin to dotnet new editorconfig that gives me some reasonable baseline that I can then tweak to my liking. I want to know what points of configurability are possible, and when there are issues with my settings file.
PSSA, in https://github.com/PowerShell/PSScriptAnalyzer/pull/2176, introduced 2 new cmdlets. The functionality of which could be exposed via PSES in the VSCode Extension.
-
New-ScriptAnalyzerSettingsFile- Creates a ScriptAnalyzer settings file populated with all rule names and rule configuration (set to default values). The file has some comment help for each field. The file is always namedPSScriptAnalyzerSettings.psd1so that automatic settings discovery inInvoke-ScriptAnalyzerpicks it up without any-Settingsparameter needed. Example outputs in this gist. -
Test-ScriptAnalyzerSettingsFile- Validates key elements of a settings file (such as hashtable keys being valid, rule names being recognised etc) and tells you what's wrong and where. Problems are returned as aDiagnosticRecordwith a best endeavours extent.
Opening this for feedback (and to raise some awareness of the new cmdlets for feedback on those too 🙂). I would be interested in giving the implementation a go, if the project think it's a reasonable idea (or some version of it) and would be happy with a PR.
Proposed Design
I'm not sure what the correct user experience is. But something like:
-
Add a code action/UI to create a new ScriptAnalyzer settings file.
If there are multiple root folders in the workspace, the user may then need to pick which folder to add it to.
The cmdlet has a
BasedOnparameter that accepts a Preset name, so you could then show a list of presets to base it on - though I'm personally not a fan of the presets.When all optional info collected, the
New-ScriptAnalyzerSettingsFilecmdlet would be called with the directory-Pathwhere the new settings file should be created. -
When the open file/active editor is called
PSScriptAnalyzerSettings.psd1: as well asInvoke-ScriptAnalyzer, also runTest-ScriptAnalyzerSettingsFileagainst the file and surface any resultingDiagnosticRecords returned.
- Lingua principale
- TypeScript
- Stelle
- 1.9k
- Fork
- 548
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di PowerShell/vscode-powershell
-
agentic-workflows
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
PowerShell/vscode-powershell#5599 · 3 commenti ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
PowerShell/vscode-powershell#5592 · 2 commenti · 1 reazione ·
-
agentic-workflows
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
PowerShell/vscode-powershell#5583 · 1 commento ·
-
powershell.scriptAnalysis.settingsPath (Description): Warning Message Should Provide A Workaround ApertaArea-Code Formatting Issue-Enhancement
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
PowerShell/vscode-powershell#4653 · 3 commenti · 4 reazioni ·
-
nothing ApertaIssue-Bug Needs: Triage
Difficoltà 5/5 Più di una settimana Idoneità per principianti 5/100
PowerShell/vscode-powershell#5603 · 1 reazione ·
Tutte le issue di PowerShell/vscode-powershell
Issue simili
-
bot:ai-assisted component:compact-js status:untriaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
midnightntwrk/midnight-sdk#403 ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
joinmarket-webui/jam#1496 · 1 commento ·
-
Tech
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
opencrvs/opencrvs-core#13865 ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
linagora/twake-calendar-frontend#1377 · 1 commento ·
-
Claiming namespace Londopy Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
EclipseFdn/open-vsx.org#13385 · 1 commento ·