Skip to content

Commit be5d727

Browse files
authored
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
1 parent 6c597e7 commit be5d727

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

examples/PSScriptAnalyzerSettings.psd1

+17-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
1-
# The PowerShell Script Analyzer will generate a warning
2-
# diagnostic record for this file due to a bug -
3-
# https://github.com/PowerShell/PSScriptAnalyzer/issues/472
1+
# Use the PowerShell extension setting `powershell.scriptAnalysis.settingsPath` to get the current workspace
2+
# to use this PSScriptAnalyzerSettings.psd1 file to configure code analysis in Visual Studio Code.
3+
# This setting is configured in the workspace's `.vscode\settings.json`.
4+
#
5+
# For more information on PSScriptAnalyzer settings see:
6+
# https://github.com/PowerShell/PSScriptAnalyzer/blob/master/README.md#settings-support-in-scriptanalyzer
7+
#
8+
# You can see the predefined PSScriptAnalyzer settings here:
9+
# https://github.com/PowerShell/PSScriptAnalyzer/tree/master/Engine/Settings
410
@{
511
# Only diagnostic records of the specified severity will be generated.
612
# Uncomment the following line if you only want Errors and Warnings but
713
# not Information diagnostic records.
814
#Severity = @('Error','Warning')
915

1016
# Analyze **only** the following rules. Use IncludeRules when you want
11-
# to invoke only a small subset of the defualt rules.
17+
# to invoke only a small subset of the default rules.
1218
IncludeRules = @('PSAvoidDefaultValueSwitchParameter',
1319
'PSMisleadingBacktick',
1420
'PSMissingModuleManifestField',
@@ -25,4 +31,11 @@
2531
# Note: if a rule is in both IncludeRules and ExcludeRules, the rule
2632
# will be excluded.
2733
#ExcludeRules = @('PSAvoidUsingWriteHost')
34+
35+
# You can use rule configuration to configure rules that support it:
36+
#Rules = @{
37+
# PSAvoidUsingCmdletAliases = @{
38+
# Whitelist = @("cd")
39+
# }
40+
#}
2841
}

0 commit comments

Comments
 (0)