Skip to content

Commit

Permalink
feat: Update pipeline files to use windows-latest image (#104)
Browse files Browse the repository at this point in the history
  • Loading branch information
PlagueHO committed Jun 10, 2024
1 parent e0b196c commit 6f4163d
Show file tree
Hide file tree
Showing 11 changed files with 1,540 additions and 429 deletions.
147 changes: 109 additions & 38 deletions .vscode/analyzersettings.psd1
Original file line number Diff line number Diff line change
@@ -1,44 +1,115 @@
@{
CustomRulePath = '.\output\RequiredModules\DscResource.AnalyzerRules'
includeDefaultRules = $true
IncludeRules = @(
# DSC Resource Kit style guideline rules.
'PSAvoidDefaultValueForMandatoryParameter',
'PSAvoidDefaultValueSwitchParameter',
'PSAvoidInvokingEmptyMembers',
'PSAvoidNullOrEmptyHelpMessageAttribute',
'PSAvoidUsingCmdletAliases',
'PSAvoidUsingComputerNameHardcoded',
'PSAvoidUsingDeprecatedManifestFields',
'PSAvoidUsingEmptyCatchBlock',
'PSAvoidUsingInvokeExpression',
'PSAvoidUsingPositionalParameters',
'PSAvoidShouldContinueWithoutForce',
'PSAvoidUsingWMICmdlet',
'PSAvoidUsingWriteHost',
'PSDSCReturnCorrectTypesForDSCFunctions',
'PSDSCStandardDSCFunctionsInResource',
'PSDSCUseIdenticalMandatoryParametersForDSC',
'PSDSCUseIdenticalParametersForDSC',
'PSMisleadingBacktick',
'PSMissingModuleManifestField',
'PSPossibleIncorrectComparisonWithNull',
'PSProvideCommentHelp',
'PSReservedCmdletChar',
'PSReservedParams',
'PSUseApprovedVerbs',
'PSUseCmdletCorrectly',
'PSUseOutputTypeCorrectly',
'PSAvoidGlobalVars',
'PSAvoidUsingConvertToSecureStringWithPlainText',
'PSAvoidUsingPlainTextForPassword',
'PSAvoidUsingUsernameAndPasswordParams',
'PSDSCUseVerboseMessageInDSCResource',
'PSShouldProcess',
'PSUseDeclaredVarsMoreThanAssignments',
'PSUsePSCredentialType',
CustomRulePath = @(
'./output/RequiredModules/DscResource.AnalyzerRules'
'./output/RequiredModules/Indented.ScriptAnalyzerRules'
)
IncludeDefaultRules = $true
IncludeRules = @(
# DSC Community style guideline rules from the module ScriptAnalyzer.
'PSAvoidDefaultValueForMandatoryParameter'
'PSAvoidDefaultValueSwitchParameter'
'PSAvoidInvokingEmptyMembers'
'PSAvoidNullOrEmptyHelpMessageAttribute'
'PSAvoidUsingCmdletAliases'
'PSAvoidUsingComputerNameHardcoded'
'PSAvoidUsingDeprecatedManifestFields'
'PSAvoidUsingEmptyCatchBlock'
'PSAvoidUsingInvokeExpression'
'PSAvoidUsingPositionalParameters'
'PSAvoidShouldContinueWithoutForce'
'PSAvoidUsingWMICmdlet'
'PSAvoidUsingWriteHost'
'PSDSCReturnCorrectTypesForDSCFunctions'
'PSDSCStandardDSCFunctionsInResource'
'PSDSCUseIdenticalMandatoryParametersForDSC'
'PSDSCUseIdenticalParametersForDSC'
'PSMisleadingBacktick'
'PSMissingModuleManifestField'
'PSPossibleIncorrectComparisonWithNull'
'PSProvideCommentHelp'
'PSReservedCmdletChar'
'PSReservedParams'
'PSUseApprovedVerbs'
'PSUseCmdletCorrectly'
'PSUseOutputTypeCorrectly'
'PSAvoidGlobalVars'
'PSAvoidUsingConvertToSecureStringWithPlainText'
'PSAvoidUsingPlainTextForPassword'
'PSAvoidUsingUsernameAndPasswordParams'
'PSDSCUseVerboseMessageInDSCResource'
'PSShouldProcess'
'PSUseDeclaredVarsMoreThanAssignments'
'PSUsePSCredentialType'

# Additional rules from the module ScriptAnalyzer
'PSUseConsistentWhitespace'
'UseCorrectCasing'
'PSPlaceOpenBrace'
'PSPlaceCloseBrace'
'AlignAssignmentStatement'
'AvoidUsingDoubleQuotesForConstantString'
'UseShouldProcessForStateChangingFunctions'

# Rules from the modules DscResource.AnalyzerRules
'Measure-*'

# Rules from the module Indented.ScriptAnalyzerRules
'AvoidCreatingObjectsFromAnEmptyString'
'AvoidDashCharacters'
'AvoidEmptyNamedBlocks'
'AvoidFilter'
'AvoidHelpMessage'
'AvoidNestedFunctions'
'AvoidNewObjectToCreatePSObject'
'AvoidParameterAttributeDefaultValues'
'AvoidProcessWithoutPipeline'
'AvoidSmartQuotes'
'AvoidThrowOutsideOfTry'
'AvoidWriteErrorStop'
'AvoidWriteOutput'
'UseSyntacticallyCorrectExamples'
)

<#
The following types are not rules but parse errors reported by PSScriptAnalyzer
so they cannot be ecluded. They need to be filtered out from the result of
Invoke-ScriptAnalyzer.
TypeNotFound - Because classes in the project cannot be found unless built.
RequiresModuleInvalid - Because 'using module' in prefix.ps1 cannot be resolved as source file.
#>
ExcludeRules = @()

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

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

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

PSAlignAssignmentStatement = @{
Enable = $true
CheckHashtable = $true
}
}
}
28 changes: 24 additions & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,22 @@
"powershell.codeFormatting.whitespaceAroundOperator": true,
"powershell.codeFormatting.whitespaceAfterSeparator": true,
"powershell.codeFormatting.ignoreOneLineBlock": false,
"powershell.codeFormatting.pipelineIndentationStyle": "IncreaseIndentationAfterEveryPipeline",
"powershell.codeFormatting.pipelineIndentationStyle": "IncreaseIndentationForFirstPipeline",
"powershell.codeFormatting.preset": "Custom",
"powershell.codeFormatting.alignPropertyValuePairs": true,
"powershell.codeFormatting.useConstantStrings": true,
"powershell.developer.bundledModulesPath": "${cwd}/output/RequiredModules",
"powershell.scriptAnalysis.settingsPath": "/.vscode/analyzersettings.psd1",
"powershell.scriptAnalysis.enable": true,
"files.trimTrailingWhitespace": true,
"files.trimFinalNewlines": true,
"files.insertFinalNewline": true,
"powershell.scriptAnalysis.settingsPath": ".vscode\\analyzersettings.psd1",
"powershell.scriptAnalysis.enable": true,
"files.associations": {
"*.ps1xml": "xml"
},
"cSpell.dictionaries": [
"powershell"
],
"cSpell.words": [
"COMPANYNAME",
"ICONURI",
Expand All @@ -32,7 +38,21 @@
"pscmdlet",
"steppable"
],
"cSpell.ignorePaths": [
".git"
],
"[markdown]": {
"files.trimTrailingWhitespace": true,
"files.encoding": "utf8"
}
},
"powershell.pester.useLegacyCodeLens": false,
"pester.testFilePath": [
"[tT]ests/[qQ][aA]/*.[tT]ests.[pP][sS]1",
"[tT]ests/[uU]nit/**/*.[tT]ests.[pP][sS]1",
"[tT]ests/[uU]nit/*.[tT]ests.[pP][sS]1"
],
"pester.runTestsInNewProcess": true,
"pester.pesterModulePath": "./output/RequiredModules/Pester",
"powershell.pester.codeLens": true,
"pester.suppressCodeLensNotice": true,
}
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed

- CI Pipeline
- Updated pipeline files to match current DSC Community patterns - fixes [Issue #103](https://github.com/dsccommunity/WSManDsc/issues/103).
- Updated HQRM and build steps to use windows-latest image.
- WSManDsc
- Added support for changing the hostname and/or certificate thumbprint on the listener - fixes [Issue #23](https://github.com/dsccommunity/WSManDsc/issues/23).

Expand Down
4 changes: 2 additions & 2 deletions GitVersion.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
mode: ContinuousDelivery
next-version: 3.0.0
major-version-bump-message: '\s?(breaking|major|breaking\schange)'
minor-version-bump-message: '\s?(add|feature|minor)'
major-version-bump-message: '(breaking\schange|breaking)\b'
minor-version-bump-message: '(adds?|minor)\b'
patch-version-bump-message: '\s?(fix|patch)'
no-bump-message: '\+semver:\s?(none|skip)'
assembly-informational-format: '{NuGetVersionV2}+Sha.{Sha}.Date.{CommitDate}'
Expand Down
37 changes: 23 additions & 14 deletions RequiredModules.psd1
Original file line number Diff line number Diff line change
@@ -1,23 +1,32 @@
@{
PSDependOptions = @{
AddToPath = $True
AddToPath = $true
Target = 'output\RequiredModules'
Parameters = @{
Repository = ''
}
}

InvokeBuild = 'latest'
PSScriptAnalyzer = 'latest'
Pester = '4.10.1'
Plaster = 'latest'
ModuleBuilder = 'latest'
ChangelogManagement = 'latest'
Sampler = 'latest'
'Sampler.GitHubTasks' = 'latest'
'DscResource.Test' = 'latest'
'DscResource.AnalyzerRules' = 'latest'
'DscResource.DocGenerator' = 'latest'
'DscResource.Common' = 'latest'
xDscResourceDesigner = 'latest'
InvokeBuild = 'latest'
PSScriptAnalyzer = 'latest'
Pester = '4.10.1'
Plaster = 'latest'
ModuleBuilder = 'latest'
ChangelogManagement = 'latest'
Sampler = 'latest'
'Sampler.GitHubTasks' = 'latest'
MarkdownLinkCheck = 'latest'
'DscResource.Test' = 'latest'
xDscResourceDesigner = 'latest'

# Build dependencies needed for using the module
'DscResource.Common' = 'latest'

# Analyzer rules
'DscResource.AnalyzerRules' = 'latest'
'Indented.ScriptAnalyzerRules' = 'latest'

# Prerequisite modules for documentation.
'DscResource.DocGenerator' = 'latest'
PlatyPS = 'latest'
}
Loading

0 comments on commit 6f4163d

Please sign in to comment.