Skip to content

Commit

Permalink
Update to latest CI pipeline pattern - Fixes dsccommunity#528 (dsccom…
Browse files Browse the repository at this point in the history
  • Loading branch information
PlagueHO authored Jun 7, 2024
1 parent 5f6ac3e commit e8b5edc
Show file tree
Hide file tree
Showing 11 changed files with 1,555 additions and 421 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,
}
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Updated CHANGELOG.md
- Renamed NetworkingDSc to NetworkingDsc in CHANGELOG.md - fixes [Issue #513](https://github.com/dsccommunity/NetworkingDsc/issues/513).
- CI Pipeline
- Updated pipeline files to match current DSC Community patterns - fixes [Issue #528](https://github.com/dsccommunity/NetworkingDsc/issues/528).
- Updated HQRM and build steps to use windows-latest image.

## [9.0.0] - 2022-05-30

Expand Down
6 changes: 3 additions & 3 deletions GitVersion.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
mode: ContinuousDelivery
next-version: 7.4.0
major-version-bump-message: '\s?(breaking|major|breaking\schange)'
minor-version-bump-message: '\s?(add|feature|minor)'
next-version: 4.1.0
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
14 changes: 11 additions & 3 deletions RequiredModules.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,17 @@
'Sampler.GitHubTasks' = 'latest'
MarkdownLinkCheck = 'latest'
'DscResource.Test' = 'latest'
'DscResource.AnalyzerRules' = 'latest'
'DscResource.DocGenerator' = 'latest'
'DscResource.Common' = 'latest'
xDscResourceDesigner = 'latest'
LoopbackAdapter = '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 e8b5edc

Please sign in to comment.