Skip to content

Commit 0d1d026

Browse files
authored
Update to latest CI pipeline pattern - Fixes #71 (#72)
1 parent 3bcfc23 commit 0d1d026

File tree

11 files changed

+1542
-432
lines changed

11 files changed

+1542
-432
lines changed

.vscode/analyzersettings.psd1

Lines changed: 109 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,115 @@
11
@{
2-
CustomRulePath = '.\output\RequiredModules\DscResource.AnalyzerRules'
3-
includeDefaultRules = $true
4-
IncludeRules = @(
5-
# DSC Resource Kit style guideline rules.
6-
'PSAvoidDefaultValueForMandatoryParameter',
7-
'PSAvoidDefaultValueSwitchParameter',
8-
'PSAvoidInvokingEmptyMembers',
9-
'PSAvoidNullOrEmptyHelpMessageAttribute',
10-
'PSAvoidUsingCmdletAliases',
11-
'PSAvoidUsingComputerNameHardcoded',
12-
'PSAvoidUsingDeprecatedManifestFields',
13-
'PSAvoidUsingEmptyCatchBlock',
14-
'PSAvoidUsingInvokeExpression',
15-
'PSAvoidUsingPositionalParameters',
16-
'PSAvoidShouldContinueWithoutForce',
17-
'PSAvoidUsingWMICmdlet',
18-
'PSAvoidUsingWriteHost',
19-
'PSDSCReturnCorrectTypesForDSCFunctions',
20-
'PSDSCStandardDSCFunctionsInResource',
21-
'PSDSCUseIdenticalMandatoryParametersForDSC',
22-
'PSDSCUseIdenticalParametersForDSC',
23-
'PSMisleadingBacktick',
24-
'PSMissingModuleManifestField',
25-
'PSPossibleIncorrectComparisonWithNull',
26-
'PSProvideCommentHelp',
27-
'PSReservedCmdletChar',
28-
'PSReservedParams',
29-
'PSUseApprovedVerbs',
30-
'PSUseCmdletCorrectly',
31-
'PSUseOutputTypeCorrectly',
32-
'PSAvoidGlobalVars',
33-
'PSAvoidUsingConvertToSecureStringWithPlainText',
34-
'PSAvoidUsingPlainTextForPassword',
35-
'PSAvoidUsingUsernameAndPasswordParams',
36-
'PSDSCUseVerboseMessageInDSCResource',
37-
'PSShouldProcess',
38-
'PSUseDeclaredVarsMoreThanAssignments',
39-
'PSUsePSCredentialType',
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'
4052

53+
# Rules from the modules DscResource.AnalyzerRules
4154
'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'
4271
)
4372

73+
<#
74+
The following types are not rules but parse errors reported by PSScriptAnalyzer
75+
so they cannot be ecluded. They need to be filtered out from the result of
76+
Invoke-ScriptAnalyzer.
77+
78+
TypeNotFound - Because classes in the project cannot be found unless built.
79+
RequiresModuleInvalid - Because 'using module' in prefix.ps1 cannot be resolved as source file.
80+
#>
81+
ExcludeRules = @()
82+
83+
Rules = @{
84+
PSUseConsistentWhitespace = @{
85+
Enable = $true
86+
CheckOpenBrace = $true
87+
CheckInnerBrace = $true
88+
CheckOpenParen = $true
89+
CheckOperator = $false
90+
CheckSeparator = $true
91+
CheckPipe = $true
92+
CheckPipeForRedundantWhitespace = $true
93+
CheckParameter = $false
94+
}
95+
96+
PSPlaceOpenBrace = @{
97+
Enable = $true
98+
OnSameLine = $false
99+
NewLineAfter = $true
100+
IgnoreOneLineBlock = $false
101+
}
102+
103+
PSPlaceCloseBrace = @{
104+
Enable = $true
105+
NoEmptyLineBefore = $true
106+
IgnoreOneLineBlock = $false
107+
NewLineAfter = $true
108+
}
109+
110+
PSAlignAssignmentStatement = @{
111+
Enable = $true
112+
CheckHashtable = $true
113+
}
114+
}
44115
}

.vscode/settings.json

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,22 @@
77
"powershell.codeFormatting.whitespaceAroundOperator": true,
88
"powershell.codeFormatting.whitespaceAfterSeparator": true,
99
"powershell.codeFormatting.ignoreOneLineBlock": false,
10-
"powershell.codeFormatting.pipelineIndentationStyle": "IncreaseIndentationAfterEveryPipeline",
10+
"powershell.codeFormatting.pipelineIndentationStyle": "IncreaseIndentationForFirstPipeline",
1111
"powershell.codeFormatting.preset": "Custom",
1212
"powershell.codeFormatting.alignPropertyValuePairs": true,
13+
"powershell.codeFormatting.useConstantStrings": true,
14+
"powershell.developer.bundledModulesPath": "${cwd}/output/RequiredModules",
15+
"powershell.scriptAnalysis.settingsPath": "/.vscode/analyzersettings.psd1",
16+
"powershell.scriptAnalysis.enable": true,
1317
"files.trimTrailingWhitespace": true,
18+
"files.trimFinalNewlines": true,
1419
"files.insertFinalNewline": true,
15-
"powershell.scriptAnalysis.settingsPath": ".vscode\\analyzersettings.psd1",
16-
"powershell.scriptAnalysis.enable": true,
1720
"files.associations": {
1821
"*.ps1xml": "xml"
1922
},
23+
"cSpell.dictionaries": [
24+
"powershell"
25+
],
2026
"cSpell.words": [
2127
"COMPANYNAME",
2228
"ICONURI",
@@ -32,7 +38,21 @@
3238
"pscmdlet",
3339
"steppable"
3440
],
41+
"cSpell.ignorePaths": [
42+
".git"
43+
],
3544
"[markdown]": {
45+
"files.trimTrailingWhitespace": true,
3646
"files.encoding": "utf8"
37-
}
47+
},
48+
"powershell.pester.useLegacyCodeLens": false,
49+
"pester.testFilePath": [
50+
"[tT]ests/[qQ][aA]/*.[tT]ests.[pP][sS]1",
51+
"[tT]ests/[uU]nit/**/*.[tT]ests.[pP][sS]1",
52+
"[tT]ests/[uU]nit/*.[tT]ests.[pP][sS]1"
53+
],
54+
"pester.runTestsInNewProcess": true,
55+
"pester.pesterModulePath": "./output/RequiredModules/Pester",
56+
"powershell.pester.codeLens": true,
57+
"pester.suppressCodeLensNotice": true,
3858
}

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3434
images - Fixes [Issue #63](https://github.com/dsccommunity/FileContentDsc/issues/63).
3535
- Updated pipeline unit tests and integration tests to use Windows Server 2019 and
3636
Windows Server 2022 images - Fixes [Issue #63](https://github.com/dsccommunity/FileContentDsc/issues/63).
37+
- CI Pipeline
38+
- Updated pipeline files to match current DSC Community patterns - fixes [Issue #71](https://github.com/dsccommunity/FileContentDsc/issues/71).
39+
- Updated HQRM and build steps to use windows-latest image.
3740

3841
### Fixed
3942

GitVersion.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
mode: ContinuousDelivery
22
next-version: 1.3.0
3-
major-version-bump-message: '\s?(breaking|major|breaking\schange)'
4-
minor-version-bump-message: '\s?(add|feature|minor)'
3+
major-version-bump-message: '(breaking\schange|breaking)\b'
4+
minor-version-bump-message: '(adds?|minor)\b'
55
patch-version-bump-message: '\s?(fix|patch)'
66
no-bump-message: '\+semver:\s?(none|skip)'
77
assembly-informational-format: '{NuGetVersionV2}+Sha.{Sha}.Date.{CommitDate}'

RequiredModules.psd1

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,26 @@
77
}
88
}
99

10-
InvokeBuild = 'latest'
11-
PSScriptAnalyzer = 'latest'
12-
Pester = '4.10.1'
13-
Plaster = 'latest'
14-
ModuleBuilder = 'latest'
15-
ChangelogManagement = 'latest'
16-
Sampler = 'latest'
17-
'Sampler.GitHubTasks' = 'latest'
18-
MarkdownLinkCheck = 'latest'
19-
'DscResource.Test' = 'latest'
20-
'DscResource.AnalyzerRules' = 'latest'
21-
'DscResource.DocGenerator' = 'latest'
22-
'DscResource.Common' = 'latest'
23-
xDscResourceDesigner = 'latest'
10+
InvokeBuild = 'latest'
11+
PSScriptAnalyzer = 'latest'
12+
Pester = '4.10.1'
13+
Plaster = 'latest'
14+
ModuleBuilder = 'latest'
15+
ChangelogManagement = 'latest'
16+
Sampler = 'latest'
17+
'Sampler.GitHubTasks' = 'latest'
18+
MarkdownLinkCheck = 'latest'
19+
'DscResource.Test' = 'latest'
20+
xDscResourceDesigner = 'latest'
21+
22+
# Build dependencies needed for using the module
23+
'DscResource.Common' = 'latest'
24+
25+
# Analyzer rules
26+
'DscResource.AnalyzerRules' = 'latest'
27+
'Indented.ScriptAnalyzerRules' = 'latest'
28+
29+
# Prerequisite modules for documentation.
30+
'DscResource.DocGenerator' = 'latest'
31+
PlatyPS = 'latest'
2432
}

0 commit comments

Comments
 (0)