icinga-powershell-framework/PSScriptAnalyzerSettings.psd1
Yonas Habteab 98603071ab Disable OnSameLine & don't check space before open brace
Because the script analyzer often complains that we can always use the
function open brace on the same line as the function name, which is not
the case, I finally decided to correct this today. I set the attribute
OnSameLine to False and disabled the check for space before open Brace.
2020-11-05 13:34:14 +01:00

67 lines
2.1 KiB
PowerShell

@{
Severity = @(
'Error',
'Warning',
'Information'
);
IncludeRules = @(
'PSAvoidUsingPositionalParameters',
'PSAvoidUsingInternalURLs',
'PSAvoidUninitializedVariable',
'PSUseApprovedVerbs',
'PSAvoidUsingCmdletAliases',
'PSAvoidUsingPlainTextForPassword',
'PSMissingModuleManifestField',
'PSUseDeclaredVarsMoreThanAssigments',
'PSAvoidTrailingWhitespace',
'PSAvoidUsingDeprecatedManifestFields',
'PSUseToExportFieldsInManifest',
'PSUseProcessBlockForPipelineCommand',
'PSUseConsistentIndentation',
'PSUseCompatibleCmdlets',
'PSUseConsistentWhitespace',
'PSAlignAssignmentStatement',
'PSUseCorrectCasing'
);
ExcludeRules = @(
'PSAvoidGlobalVars',
'PSUseSingularNouns',
'PSAvoidUsingWriteHost'
)
Rules = @{
PSUseCompatibleCmdlets = @{
Compatibility = @("4.0")
};
PSPlaceOpenBrace = @{
Enable = $true
OnSameLine = $false
NewLineAfter = $true
IgnoreOneLineBlock = $true
};
PSPlaceCloseBrace = @{
Enable = $true
NewLineAfter = $true
IgnoreOneLineBlock = $true
NoEmptyLineBefore = $true
};
PSUseConsistentIndentation = @{
Enable = $true
Kind = 'space'
IndentationSize = 4
PipelineIndentation = 'IncreaseIndentationForFirstPipeline'
};
PSUseConsistentWhitespace = @{
Enable = $true
CheckOpenBrace = $false
CheckOpenParen = $true
CheckOperator = $false
CheckSeparator = $true
};
PSAlignAssignmentStatement = @{
Enable = $true
};
PSUseCorrectCasing = @{
Enable = $true
};
}
}