ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Sublime​Linter-contrib-PSScript​Analyzer

by spajak ST3

Sublime Text Linter for PowerShell Core

Details

  • 1.0.1
  • github.​com
  • github.​com
  • 2 months ago
  • 19 minutes ago
  • 2 months ago

Installs

  • Total 45
  • Win 36
  • Mac 4
  • Linux 5
May 16 May 15 May 14 May 13 May 12 May 11 May 10 May 9 May 8 May 7 May 6 May 5 May 4 May 3 May 2 May 1 Apr 30 Apr 29 Apr 28 Apr 27 Apr 26 Apr 25 Apr 24 Apr 23 Apr 22 Apr 21 Apr 20 Apr 19 Apr 18 Apr 17 Apr 16 Apr 15 Apr 14 Apr 13 Apr 12 Apr 11 Apr 10 Apr 9 Apr 8 Apr 7 Apr 6 Apr 5 Apr 4 Apr 3 Apr 2 Apr 1
Windows 0 0 0 3 0 0 2 0 0 2 0 2 0 1 0 1 0 0 0 2 1 0 1 0 1 0 1 0 1 0 0 0 0 0 1 0 0 0 0 1 0 3 1 0 0 2
Mac 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0
Linux 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0

Readme

Source
raw.​githubusercontent.​com

SublimeLinter-contrib-PSScriptAnalyzer

Build Status

This linter plugin for SublimeLinter provides an interface to PowerShell's PSScriptAnalyzer module. It will be used with files that have the “PowerShell” syntax.

Installation

SublimeLinter must be installed in order to use this plugin.

Please use Package Control to install the linter plugin.

Before installing this plugin, you must ensure that:

Install-Module -Name PSScriptAnalyzer

In order for pwsh to be executed by SublimeLinter, you must ensure that its path is available to SublimeLinter. The docs cover troubleshooting PATH configuration.

PSScriptAnalyzer settings

If a file named PSScriptAnalyzerSettings.psd1 exists in the user's home directory it's used as PSScriptAnalyzer's settings file when calling Invoke-ScriptAnalyzer cmdlet. Please refer to PSScriptAnalyzer for details.

Example content of a settings file:

@{
    # Select which diagnostic records to show.
    # Valid values are: ParseError, Error, Warning, Information
    Severity = @('ParseError', 'Error', 'Warning')

    ExcludeRules = @(
        'PSUseApprovedVerbs'
    )

    IncludeDefaultRules = $true
}

Path/name of the PSScriptAnalyzer's settings can be customized:

"linters": {
    ...
    "psscriptanalyzer": {
        // full path
        "settings": "D:\\Scripts\\CustomSettings.psd1"
        // environment variables will be expanded
        "settings": "%SCRIPTS_DIR%\\CustomSettings.psd1"
        // or built-in preset name (beware that linting fails if the name is not a valid preset name)
        "settings": "PSGallery"
        // default - remove or set to null
        "settings": null
    }

General Settings

TODO

  • Handle the case when a given preset name is not a valid PSScriptAnalyzer preset. Now it just fails to lint.