icinga-powershell-framework/PSScriptAnalyzerSettings.psd1
Lord Hepipud 4ef55bddb4 Fixes lots of code styling, spelling and script analyzer
Disabling UseConsistentIndentation because it is not
properly working for multi-line commands with arguments
and array/hashtable objects
2022-01-14 22:26:53 +01:00

69 lines
2.2 KiB
PowerShell

@{
Severity = @(
'Error',
'Warning',
'Information'
);
IncludeRules = @(
'PSAvoidUsingPositionalParameters',
'PSAvoidUsingInternalURLs',
'PSAvoidUninitializedVariable',
'PSUseApprovedVerbs',
'PSAvoidUsingCmdletAliases',
'PSAvoidUsingPlainTextForPassword',
'PSMissingModuleManifestField',
'PSUseDeclaredVarsMoreThanAssigments',
'PSAvoidTrailingWhitespace',
'PSAvoidUsingDeprecatedManifestFields',
'PSUseProcessBlockForPipelineCommand',
'PSUseConsistentIndentation',
'PSUseCompatibleCmdlets',
'PSUseConsistentWhitespace',
'PSAlignAssignmentStatement',
'PSUseCorrectCasing'
);
ExcludeRules = @(
'PSAvoidGlobalVars',
'PSUseSingularNouns',
'PSAvoidUsingWriteHost',
'PSUseToExportFieldsInManifest'
)
Rules = @{
PSUseCompatibleCmdlets = @{
Compatibility = @("4.0")
};
PSPlaceOpenBrace = @{
Enable = $true
OnSameLine = $false
NewLineAfter = $true
IgnoreOneLineBlock = $true
};
PSPlaceCloseBrace = @{
Enable = $true
NewLineAfter = $true
IgnoreOneLineBlock = $true
NoEmptyLineBefore = $true
};
# Disabled for the moment, as the indentation handling is not properly
# handling multi-line arrays and hashtables
PSUseConsistentIndentation = @{
Enable = $false
Kind = 'space'
IndentationSize = 4
PipelineIndentation = 'IncreaseIndentationAfterEveryPipeline'
};
PSUseConsistentWhitespace = @{
Enable = $true
CheckOpenBrace = $false
CheckOpenParen = $true
CheckOperator = $false
CheckSeparator = $true
};
PSAlignAssignmentStatement = @{
Enable = $true
};
PSUseCorrectCasing = @{
Enable = $true
};
}
}