From be5d727e051b982195e5c1bdebd533b8440f24c7 Mon Sep 17 00:00:00 2001 From: Keith Hill Date: Mon, 7 May 2018 15:53:07 -0600 Subject: [PATCH] Updates to Examples PSSA settings file to include more rule config (#1312) * Updates to Examples PSSA settings file to include more rule config * Address PR feedback * Fix typo - defualt * Whitespace only change --- examples/PSScriptAnalyzerSettings.psd1 | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/examples/PSScriptAnalyzerSettings.psd1 b/examples/PSScriptAnalyzerSettings.psd1 index 2834ae976c..31fccb78d4 100644 --- a/examples/PSScriptAnalyzerSettings.psd1 +++ b/examples/PSScriptAnalyzerSettings.psd1 @@ -1,6 +1,12 @@ -# The PowerShell Script Analyzer will generate a warning -# diagnostic record for this file due to a bug - -# https://github.com/PowerShell/PSScriptAnalyzer/issues/472 +# Use the PowerShell extension setting `powershell.scriptAnalysis.settingsPath` to get the current workspace +# to use this PSScriptAnalyzerSettings.psd1 file to configure code analysis in Visual Studio Code. +# This setting is configured in the workspace's `.vscode\settings.json`. +# +# For more information on PSScriptAnalyzer settings see: +# https://github.com/PowerShell/PSScriptAnalyzer/blob/master/README.md#settings-support-in-scriptanalyzer +# +# You can see the predefined PSScriptAnalyzer settings here: +# https://github.com/PowerShell/PSScriptAnalyzer/tree/master/Engine/Settings @{ # Only diagnostic records of the specified severity will be generated. # Uncomment the following line if you only want Errors and Warnings but @@ -8,7 +14,7 @@ #Severity = @('Error','Warning') # Analyze **only** the following rules. Use IncludeRules when you want - # to invoke only a small subset of the defualt rules. + # to invoke only a small subset of the default rules. IncludeRules = @('PSAvoidDefaultValueSwitchParameter', 'PSMisleadingBacktick', 'PSMissingModuleManifestField', @@ -25,4 +31,11 @@ # Note: if a rule is in both IncludeRules and ExcludeRules, the rule # will be excluded. #ExcludeRules = @('PSAvoidUsingWriteHost') + + # You can use rule configuration to configure rules that support it: + #Rules = @{ + # PSAvoidUsingCmdletAliases = @{ + # Whitelist = @("cd") + # } + #} }