mirror of
https://github.com/ScoopInstaller/Scoop.git
synced 2025-10-30 14:17:54 +00:00
[Pending] Finally we add the code linting and its tests! (#2108)
* Lint: PSPossibleIncorrectComparisonWithNull * Lint: PSUseLiteralInitializerForHashtable * Lint: PSUseBOMForUnicodeEncodedFile * Lint: PSUseApprovedVerbs * Lint: PSAvoidGlobalVars * Lint: PSAvoidUsingEmptyCatchBlock * Lint: PSUseShouldProcessForStateChangingFunctions * Lint helper: Add PSScriptAnalyzer integration for vscode * Fix lint: PSUseBOMForUnicodeEncodedFile * Tests: ignore previous TestResults.xml * Tests: add PowerShell script linting into tests! * Add PSScriptAnalyzer into appveyor ci * Update Scoop-Linting.Tests.ps1
This commit is contained in:
committed by
Richard Kuhnt
parent
2d9f964068
commit
731247876d
37
PSScriptAnalyzerSettings.psd1
Normal file
37
PSScriptAnalyzerSettings.psd1
Normal file
@@ -0,0 +1,37 @@
|
||||
# The PowerShell Script Analyzer will generate a warning
|
||||
# diagnostic record for this file due to a bug -
|
||||
# https://github.com/PowerShell/PSScriptAnalyzer/issues/472
|
||||
@{
|
||||
# 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.
|
||||
# IncludeRules = @('PSAvoidDefaultValueSwitchParameter',
|
||||
# 'PSMisleadingBacktick',
|
||||
# 'PSMissingModuleManifestField',
|
||||
# 'PSReservedCmdletChar',
|
||||
# 'PSReservedParams',
|
||||
# 'PSShouldProcess',
|
||||
# 'PSUseApprovedVerbs',
|
||||
# 'PSAvoidUsingCmdletAliases',
|
||||
# 'PSUseDeclaredVarsMoreThanAssignments')
|
||||
|
||||
# Do not analyze the following rules. Use ExcludeRules when you have
|
||||
# commented out the IncludeRules settings above and want to include all
|
||||
# the default rules except for those you exclude below.
|
||||
# Note: if a rule is in both IncludeRules and ExcludeRules, the rule
|
||||
# will be excluded.
|
||||
ExcludeRules = @(
|
||||
# Currently Scoop widely uses Write-Host to output colored text.
|
||||
'PSAvoidUsingWriteHost',
|
||||
# Temporarily allow uses of Invoke-Expression,
|
||||
# this command is used by some core functions and hard to be removed.
|
||||
'PSAvoidUsingInvokeExpression',
|
||||
# PSUseDeclaredVarsMoreThanAssignments doesn't currently work due to:
|
||||
# https://github.com/PowerShell/PSScriptAnalyzer/issues/636
|
||||
'PSUseDeclaredVarsMoreThanAssignments'
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user