|
1 | | -@{ |
2 | | - CustomRulePath = @( |
3 | | - './output/RequiredModules/DscResource.AnalyzerRules' |
4 | | - './output/RequiredModules/Indented.ScriptAnalyzerRules' |
5 | | - ) |
6 | | - IncludeDefaultRules = $true |
7 | | - IncludeRules = @( |
8 | | - # DSC Community style guideline rules from the module ScriptAnalyzer. |
9 | | - 'PSAvoidDefaultValueForMandatoryParameter' |
10 | | - 'PSAvoidDefaultValueSwitchParameter' |
11 | | - 'PSAvoidInvokingEmptyMembers' |
12 | | - 'PSAvoidNullOrEmptyHelpMessageAttribute' |
13 | | - 'PSAvoidUsingCmdletAliases' |
14 | | - 'PSAvoidUsingComputerNameHardcoded' |
15 | | - 'PSAvoidUsingDeprecatedManifestFields' |
16 | | - 'PSAvoidUsingEmptyCatchBlock' |
17 | | - 'PSAvoidUsingInvokeExpression' |
18 | | - 'PSAvoidUsingPositionalParameters' |
19 | | - 'PSAvoidShouldContinueWithoutForce' |
20 | | - 'PSAvoidUsingWMICmdlet' |
21 | | - 'PSAvoidUsingWriteHost' |
22 | | - 'PSDSCReturnCorrectTypesForDSCFunctions' |
23 | | - 'PSDSCStandardDSCFunctionsInResource' |
24 | | - 'PSDSCUseIdenticalMandatoryParametersForDSC' |
25 | | - 'PSDSCUseIdenticalParametersForDSC' |
26 | | - 'PSMisleadingBacktick' |
27 | | - 'PSMissingModuleManifestField' |
28 | | - 'PSPossibleIncorrectComparisonWithNull' |
29 | | - 'PSProvideCommentHelp' |
30 | | - 'PSReservedCmdletChar' |
31 | | - 'PSReservedParams' |
32 | | - 'PSUseApprovedVerbs' |
33 | | - 'PSUseCmdletCorrectly' |
34 | | - 'PSUseOutputTypeCorrectly' |
35 | | - 'PSAvoidGlobalVars' |
36 | | - 'PSAvoidUsingConvertToSecureStringWithPlainText' |
37 | | - 'PSAvoidUsingPlainTextForPassword' |
38 | | - 'PSAvoidUsingUsernameAndPasswordParams' |
39 | | - 'PSDSCUseVerboseMessageInDSCResource' |
40 | | - 'PSShouldProcess' |
41 | | - 'PSUseDeclaredVarsMoreThanAssignments' |
42 | | - 'PSUsePSCredentialType' |
43 | | - |
44 | | - # Additional rules from the module ScriptAnalyzer |
45 | | - 'PSUseConsistentWhitespace' |
46 | | - 'UseCorrectCasing' |
47 | | - 'PSPlaceOpenBrace' |
48 | | - 'PSPlaceCloseBrace' |
49 | | - 'AlignAssignmentStatement' |
50 | | - 'AvoidUsingDoubleQuotesForConstantString' |
51 | | - 'UseShouldProcessForStateChangingFunctions' |
52 | | - |
53 | | - # Rules from the modules DscResource.AnalyzerRules |
54 | | - 'Measure-*' |
55 | | - |
56 | | - # Rules from the module Indented.ScriptAnalyzerRules |
57 | | - 'AvoidCreatingObjectsFromAnEmptyString' |
58 | | - 'AvoidDashCharacters' |
59 | | - 'AvoidEmptyNamedBlocks' |
60 | | - 'AvoidFilter' |
61 | | - 'AvoidHelpMessage' |
62 | | - 'AvoidNestedFunctions' |
63 | | - 'AvoidNewObjectToCreatePSObject' |
64 | | - 'AvoidParameterAttributeDefaultValues' |
65 | | - 'AvoidProcessWithoutPipeline' |
66 | | - 'AvoidSmartQuotes' |
67 | | - 'AvoidThrowOutsideOfTry' |
68 | | - 'AvoidWriteErrorStop' |
69 | | - 'AvoidWriteOutput' |
70 | | - 'UseSyntacticallyCorrectExamples' |
71 | | - ) |
72 | | - |
73 | | - # TODO: This is not excluded correctly, see test QA/ScriptAnalyzer.Tests.ps1 for more information. |
74 | | - ExcludeRules = @( |
75 | | - 'TypeNotFound' |
76 | | - ) |
77 | | - |
78 | | - Rules = @{ |
79 | | - PSUseConsistentWhitespace = @{ |
80 | | - Enable = $true |
81 | | - CheckOpenBrace = $true |
82 | | - CheckInnerBrace = $true |
83 | | - CheckOpenParen = $true |
84 | | - CheckOperator = $false |
85 | | - CheckSeparator = $true |
86 | | - CheckPipe = $true |
87 | | - CheckPipeForRedundantWhitespace = $true |
88 | | - CheckParameter = $false |
89 | | - } |
90 | | - |
91 | | - PSPlaceOpenBrace = @{ |
92 | | - Enable = $true |
93 | | - OnSameLine = $false |
94 | | - NewLineAfter = $true |
95 | | - IgnoreOneLineBlock = $false |
96 | | - } |
97 | | - |
98 | | - PSPlaceCloseBrace = @{ |
99 | | - Enable = $true |
100 | | - NoEmptyLineBefore = $true |
101 | | - IgnoreOneLineBlock = $false |
102 | | - NewLineAfter = $true |
103 | | - } |
104 | | - |
105 | | - PSAlignAssignmentStatement = @{ |
106 | | - Enable = $true |
107 | | - CheckHashtable = $true |
108 | | - } |
109 | | - } |
110 | | -} |
| 1 | +@{ |
| 2 | + CustomRulePath = @( |
| 3 | + './output/RequiredModules/DscResource.AnalyzerRules' |
| 4 | + './output/RequiredModules/Indented.ScriptAnalyzerRules' |
| 5 | + ) |
| 6 | + IncludeDefaultRules = $true |
| 7 | + IncludeRules = @( |
| 8 | + # DSC Community style guideline rules from the module ScriptAnalyzer. |
| 9 | + 'PSAvoidDefaultValueForMandatoryParameter' |
| 10 | + 'PSAvoidDefaultValueSwitchParameter' |
| 11 | + 'PSAvoidInvokingEmptyMembers' |
| 12 | + 'PSAvoidNullOrEmptyHelpMessageAttribute' |
| 13 | + 'PSAvoidUsingCmdletAliases' |
| 14 | + 'PSAvoidUsingComputerNameHardcoded' |
| 15 | + 'PSAvoidUsingDeprecatedManifestFields' |
| 16 | + 'PSAvoidUsingEmptyCatchBlock' |
| 17 | + 'PSAvoidUsingInvokeExpression' |
| 18 | + 'PSAvoidUsingPositionalParameters' |
| 19 | + 'PSAvoidShouldContinueWithoutForce' |
| 20 | + 'PSAvoidUsingWMICmdlet' |
| 21 | + 'PSAvoidUsingWriteHost' |
| 22 | + 'PSDSCReturnCorrectTypesForDSCFunctions' |
| 23 | + 'PSDSCStandardDSCFunctionsInResource' |
| 24 | + 'PSDSCUseIdenticalMandatoryParametersForDSC' |
| 25 | + 'PSDSCUseIdenticalParametersForDSC' |
| 26 | + 'PSMisleadingBacktick' |
| 27 | + 'PSMissingModuleManifestField' |
| 28 | + 'PSPossibleIncorrectComparisonWithNull' |
| 29 | + 'PSProvideCommentHelp' |
| 30 | + 'PSReservedCmdletChar' |
| 31 | + 'PSReservedParams' |
| 32 | + 'PSUseApprovedVerbs' |
| 33 | + 'PSUseCmdletCorrectly' |
| 34 | + 'PSUseOutputTypeCorrectly' |
| 35 | + 'PSAvoidGlobalVars' |
| 36 | + 'PSAvoidUsingConvertToSecureStringWithPlainText' |
| 37 | + 'PSAvoidUsingPlainTextForPassword' |
| 38 | + 'PSAvoidUsingUsernameAndPasswordParams' |
| 39 | + 'PSDSCUseVerboseMessageInDSCResource' |
| 40 | + 'PSShouldProcess' |
| 41 | + 'PSUseDeclaredVarsMoreThanAssignments' |
| 42 | + 'PSUsePSCredentialType' |
| 43 | + |
| 44 | + # Additional rules from the module ScriptAnalyzer |
| 45 | + 'PSUseConsistentWhitespace' |
| 46 | + 'UseCorrectCasing' |
| 47 | + 'PSPlaceOpenBrace' |
| 48 | + 'PSPlaceCloseBrace' |
| 49 | + 'AlignAssignmentStatement' |
| 50 | + 'AvoidUsingDoubleQuotesForConstantString' |
| 51 | + 'UseShouldProcessForStateChangingFunctions' |
| 52 | + |
| 53 | + # Rules from the modules DscResource.AnalyzerRules |
| 54 | + 'Measure-*' |
| 55 | + |
| 56 | + # Rules from the module Indented.ScriptAnalyzerRules |
| 57 | + 'AvoidCreatingObjectsFromAnEmptyString' |
| 58 | + 'AvoidDashCharacters' |
| 59 | + 'AvoidEmptyNamedBlocks' |
| 60 | + 'AvoidFilter' |
| 61 | + 'AvoidHelpMessage' |
| 62 | + 'AvoidNestedFunctions' |
| 63 | + 'AvoidNewObjectToCreatePSObject' |
| 64 | + 'AvoidParameterAttributeDefaultValues' |
| 65 | + 'AvoidProcessWithoutPipeline' |
| 66 | + 'AvoidSmartQuotes' |
| 67 | + 'AvoidThrowOutsideOfTry' |
| 68 | + 'AvoidWriteErrorStop' |
| 69 | + 'AvoidWriteOutput' |
| 70 | + 'UseSyntacticallyCorrectExamples' |
| 71 | + ) |
| 72 | + |
| 73 | + # TODO: This is not excluded correctly, see test QA/ScriptAnalyzer.Tests.ps1 for more information. |
| 74 | + ExcludeRules = @( |
| 75 | + 'TypeNotFound' |
| 76 | + ) |
| 77 | + |
| 78 | + Rules = @{ |
| 79 | + PSUseConsistentWhitespace = @{ |
| 80 | + Enable = $true |
| 81 | + CheckOpenBrace = $true |
| 82 | + CheckInnerBrace = $true |
| 83 | + CheckOpenParen = $true |
| 84 | + CheckOperator = $false |
| 85 | + CheckSeparator = $true |
| 86 | + CheckPipe = $true |
| 87 | + CheckPipeForRedundantWhitespace = $true |
| 88 | + CheckParameter = $false |
| 89 | + } |
| 90 | + |
| 91 | + PSPlaceOpenBrace = @{ |
| 92 | + Enable = $true |
| 93 | + OnSameLine = $false |
| 94 | + NewLineAfter = $true |
| 95 | + IgnoreOneLineBlock = $false |
| 96 | + } |
| 97 | + |
| 98 | + PSPlaceCloseBrace = @{ |
| 99 | + Enable = $true |
| 100 | + NoEmptyLineBefore = $true |
| 101 | + IgnoreOneLineBlock = $false |
| 102 | + NewLineAfter = $true |
| 103 | + } |
| 104 | + |
| 105 | + PSAlignAssignmentStatement = @{ |
| 106 | + Enable = $true |
| 107 | + CheckHashtable = $true |
| 108 | + } |
| 109 | + } |
| 110 | +} |
0 commit comments