Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates to Examples PSSA settings file to include more rule config #1312

Merged
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions examples/PSScriptAnalyzerSettings.psd1
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
# 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
Copy link
Contributor

@bergmeister bergmeister May 6, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also linking to the shipped settings files (as real examples) could be useful: https://github.com/PowerShell/PSScriptAnalyzer/tree/master/Engine/Settings

#
# 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
# not Information diagnostic records.
#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',
Expand All @@ -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")
# }
# }
}