This repository was archived by the owner on Sep 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Feature: PowerShell checker #2206
Copy link
Copy link
Open
Labels
Description
It would be nice to have a checker for PowerShell.
Ingredients:
Presumable requirements:
- Obviously, Windows because PSScriptAnalyzer is available only as a PowerShell module.
- https://github.com/Microsoft/WSL : As Syntastic will not run in PowerShell, bash console will be necessary.
Current working (!) setup:
With
au FileType ps1 let &makeprg="cd /mnt/c && powershell.exe 'Invoke-ScriptAnalyzer " . substitute(expand("%:p"), "/mnt/c/", "C:\\", "") . ' -EA SilentlyContinue \| ForEach-Object { (\"/mnt/c$((Split-Path -NoQualifier $_.ScriptPath) -replace \"\\\\\", \"/\")\", $_.Line, $_.Column, $_.Severity.ToString()[0], \"[$($_.RuleName)] $($_.Message)$(If ($_.SuggestedCorrections.Description) { \" FIX: $($_.SuggestedCorrections.Description)\" })\") -join \":\"}' . "'"
au FileType ps1 set errorformat=%f:%l:%c:%t:%m, I am able to execute :make and will get my quickfix list filled.
Unfortunately, I have no deep insights into checkers and will not be able to get them in the near future. When someone is willing to write this up, I can assist in testing for sure.
Reactions are currently unavailable