Skip to content
Permalink
Browse files

Update VS Code settings and PSSA rules file (#6047)

* forcing PS Extension to use our settings file at workspace level

* adding releative path to rules file in settings

* Updating rules file to cover formatting standard

* adding docker extension recommendation
  • Loading branch information...
wsmelton authored and potatoqualitee committed Sep 20, 2019
1 parent 3eeedb6 commit 91a1cafd6ca245ecf0943e7477ccf805fc1070b2
Showing with 86 additions and 24 deletions.
  1. +2 −1 .vscode/extensions.json
  2. +2 −1 .vscode/settings.json
  3. +82 −22 bin/PSScriptAnalyzerRules.psd1
@@ -3,6 +3,7 @@
// for the documentation about the extensions.json format
"recommendations": [
"ms-vscode.PowerShell",
"dbatools.search"
"dbatools.search",
"ms-azuretools.vscode-docker"
]
}
@@ -17,5 +17,6 @@
// https://twitter.com/TylerLeonhardt/status/1102749805233737729
"[powershell]": {
"editor.wordSeparators": "`~!@#%^&*()-=+[{]}\\|;:'\",.<>/?"
}
},
"powershell.scriptAnalysis.settingsPath": "bin\\PSScriptAnalyzerRules.psd1"
}
@@ -1,25 +1,85 @@
@{
Severity = @('Error')
IncludeRules = @(
'PSAvoidUsingCmdletAliases',
'PSAvoidUsingWriteHost',
'PSAvoidDefaultValueSwitchParameter',
'PSReservedCmdletChar',
'PSReservedParams',
'PSAvoidUsingUserNameAndPassWordParams',
'PSAvoidUsingPlaintTextForPassword',
'PSAvoidUsingWMICmdlet',
'PSAvoidUsingWriteHost',
'PSMisleadingBacktick',
'PSMissingModuleMainifestField',
'PSPossibleIncorrectComparisonWithNull',
'PSUseApprovedVerbs',
'PSUseOutputTypeCorrectly',
'PSShouldProcess',
'PSUserToExportFieldsInManifest',
'PSUseSingularNouns',
'PSAvoidUsingInvokeExpression',
'PSUseShouldProcessForStateChangingFunctions',
'PSUseDeclaredVarsMoreThanAssignments'
)
'PSUseCompatibleSyntax',
'PSAvoidUsingCmdletAliases',
'PSAvoidUsingWriteHost',
'PSAvoidDefaultValueSwitchParameter',
'PSReservedCmdletChar',
'PSReservedParams',
'PSAvoidUsingUserNameAndPassWordParams',
'PSAvoidUsingPlaintTextForPassword',
'PSAvoidUsingWMICmdlet',
'PSAvoidUsingWriteHost',
'PSMisleadingBacktick',
'PSMissingModuleManifestField',
'PSPossibleIncorrectComparisonWithNull',
'PSUseApprovedVerbs',
'PSUseOutputTypeCorrectly',
'PSShouldProcess',
'PSUserToExportFieldsInManifest',
'PSUseSingularNouns',
'PSAvoidUsingInvokeExpression',
'PSUseShouldProcessForStateChangingFunctions',
'PSUseDeclaredVarsMoreThanAssignments',
'PSUseCore',
'PSPlaceOpenBrace',
'PSPlaceCloseBrace',
'PSUseConsistentWhitespace',
'PSUseConsistentIndentation',
'PSAlignAssignmentStatement',
'PSUseCorrectCasing'

)
Rules = @{
PSUseCompatibleSyntax = @{
Enable = $true
TargetVersion = @(
'3.0',
'4.0',
'5.1',
'6.2'
)
}

PSPlaceOpenBrace = @{
Enable = $true
OnSameLine = $true
NewLineAfter = $true
IgnoreOneLineBlock = $true
}

PSPlaceCloseBrace = @{
Enable = $true
NewLineAfter = $false
IgnoreOneLineBlock = $true
NoEmptyLineBefore = $false
}

PSUseConsistentIndentation = @{
Enable = $true
Kind = 'space'
PipelineIndentation = 'IncreaseIndentationForFirstPipeline'
IndentationSize = 4
}

PSUseConsistentWhitespace = @{
Enable = $true
CheckInnerBrace = $true
CheckOpenBrace = $true
CheckOpenParen = $true
CheckOperator = $false
CheckPipe = $true
CheckSeparator = $true
}

PSAlignAssignmentStatement = @{
Enable = $true
CheckHashtable = $true
}

PSUseCorrectCasing = @{
Enable = $true
}
}
}

0 comments on commit 91a1caf

Please sign in to comment.
You can’t perform that action at this time.