From 88197051ca5c9483b1291f67daa34ec70c2a8007 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sun, 16 Feb 2025 12:58:23 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Update=20linter=20con?= =?UTF-8?q?figurations=20and=20license=20year=20(#106)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description This pull request includes several updates to the configuration files and PowerShell scripts to enhance code quality and maintainability. The most important changes include updates to the JSCPD and PSScriptAnalyzer configurations, adjustments to the module requirements in various scripts, and suppression of specific warnings. ### Configuration Updates: * [`.github/linters/.jscpd.json`](diffhunk://#diff-557094e283c00b23265c1c75872f41c6b1a524a00f0d99dd68ebd22cb63bfdd6R1-R14): Added a new configuration file for JSCPD to set the threshold to 0, specify reporters, and ignore certain paths. * [`.github/linters/.powershell-psscriptanalyzer.psd1`](diffhunk://#diff-aae69c9d6774628ed181eacf53aee0f38eb6c2f53492cf3a5b7f7bdb6ef43b6aL1-L17): Updated the PSScriptAnalyzer configuration to enable specific rules and adjust the excluded rules. ### Module Requirement Adjustments: * `scripts/helpers/Build-PSModule.ps1`, `scripts/helpers/Build/Build-PSModuleBase.ps1`, `scripts/helpers/Build/Build-PSModuleManifest.ps1`, `scripts/helpers/Build/Get-PSModuleAliasesToExport.ps1`, `scripts/helpers/Build/Get-PSModuleCmdletsToExport.ps1`, `scripts/helpers/Build/Get-PSModuleFunctionsToExport.ps1`, `scripts/helpers/Build/Get-PSModuleVariablesToExport.ps1`, `scripts/helpers/Build/Import-PSModule.ps1`, `scripts/helpers/Build/Resolve-PSModuleDependency.ps1`, `scripts/helpers/Build/Update-PSModuleManifestAliasesToExport.ps1`, `scripts/main.ps1`: Re-added the `#Requires -Modules` directive for required modules and added suppression for `PSAvoidUsingWriteHost` warnings. [[1]](diffhunk://#diff-c688e346ad60fbe881bd05b6a5dbc1cd712fdca0bf8b8527965db583af825fd9R10-R19) [[2]](diffhunk://#diff-1ab7417b36702be4629b208ad7dd9ec76f94998bb625c4810edda2f9b5dbddb8R14-R22) [[3]](diffhunk://#diff-50cfb011f5c8aeef8145003927ec3e5edfdf26e5d417bcee6e441517c07454f9R14-R15) [[4]](diffhunk://#diff-ae18191466ffa02c1a8429365cf96d8768f5eae03331c4a35199f8cd961e76a7R13-R17) [[5]](diffhunk://#diff-f542f4a75d778df60fee6e176c795e133be2ed109d8212c05aa545383bd26c46R13-R17) [[6]](diffhunk://#diff-d35d4bdcf90f10b73b3318d21c09dd5f8b9ca52fef3d2aa84ac0d0388011ee29R13-R16) [[7]](diffhunk://#diff-e2148fcf63283d70b3d432f67fc98191e2cc712dc3f4d30914c8c0810d11a6deR13-R16) [[8]](diffhunk://#diff-15f2301e39f56f54fa469db56cc7c487e2df36eb295bb74e8d2325aabcd164c0R15-R19) [[9]](diffhunk://#diff-b278dc96f784d462b15a4fe67b088a5b5d9cc502dd6eba3d660da085e576652fR19-R25) [[10]](diffhunk://#diff-faeb855accbc346b12f7a0ece1d91f67e26e8929ab8133aedca4051d179c66faR14-R19) [[11]](diffhunk://#diff-dc2e5a659836b1b73abb03421c567f5018c2755677c4a0aa764cb26117b68011L1-R9) ### License Update: * `LICENSE`: Updated the copyright year from 2024 to 2025. (F75789b6L1) ### Linter Workflow Adjustment: * [`.github/workflows/Linter.yml`](diffhunk://#diff-482e65806ed9e4a7320f14964764086b91fed4a28d12e4efde1776472e147e79L30-R30): Changed the validation setting from `VALIDATE_JSCPD` to `VALIDATE_JSON_PRETTIER`. ### Script Output Adjustments: * `tests/tools/1-build.ps1`, `tests/tools/2-build.ps1`: Changed the output from `Write-Host` to a direct string output. [[1]](diffhunk://#diff-de6d50a7c32f536bea22dc71c6514d47d7d54d859ef5473045ac801f055ac380L1-R1) [[2]](diffhunk://#diff-e522bb466e514d213416a3b0ab344605da146583de06b3b94fa5cce84d370109L1-R1) ## Type of change - [ ] 📖 [Docs] - [ ] 🪲 [Fix] - [x] 🩹 [Patch] - [ ] ⚠️ [Security fix] - [ ] 🚀 [Feature] - [ ] 🌟 [Breaking change] ## Checklist - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas --- .github/linters/.jscpd.json | 14 + .../linters/.powershell-psscriptanalyzer.psd1 | 68 ++- .github/linters/.textlintrc | 513 ++++++++++++++++++ .github/workflows/Linter.yml | 2 +- .gitignore | 11 +- LICENSE | 2 +- scripts/helpers/Build-PSModule.ps1 | 11 +- scripts/helpers/Build/Build-PSModuleBase.ps1 | 23 +- .../helpers/Build/Build-PSModuleManifest.ps1 | 25 +- .../Build/Get-PSModuleAliasesToExport.ps1 | 9 +- .../Build/Get-PSModuleCmdletsToExport.ps1 | 9 +- .../Build/Get-PSModuleFunctionsToExport.ps1 | 4 + .../Build/Get-PSModuleVariablesToExport.ps1 | 4 + scripts/helpers/Build/Import-PSModule.ps1 | 9 +- .../helpers/Build/PSScriptAnalyzer.Tests.psd1 | 1 - .../Build/Resolve-PSModuleDependency.ps1 | 31 +- ...Update-PSModuleManifestAliasesToExport.ps1 | 15 +- scripts/main.ps1 | 8 +- tests/tools/1-build.ps1 | 2 +- tests/tools/2-build.ps1 | 2 +- 20 files changed, 682 insertions(+), 81 deletions(-) create mode 100644 .github/linters/.jscpd.json create mode 100644 .github/linters/.textlintrc diff --git a/.github/linters/.jscpd.json b/.github/linters/.jscpd.json new file mode 100644 index 0000000..7cc00e6 --- /dev/null +++ b/.github/linters/.jscpd.json @@ -0,0 +1,14 @@ +{ + "threshold": 0, + "reporters": [ + "consoleFull" + ], + "ignore": [ + "**/tests/**", + "**/.github/workflows/Action-Test.yml", + "**/scripts/helpers/Build/Build-PSModuleManifest.ps1", + "**/scripts/helpers/Build/Build-PSModuleRootModule.ps1", + "**/scripts/helpers/Build/PSScriptAnalyzer.Tests.psd1" + ], + "absolute": true +} diff --git a/.github/linters/.powershell-psscriptanalyzer.psd1 b/.github/linters/.powershell-psscriptanalyzer.psd1 index 40d11d6..09cc3d0 100644 --- a/.github/linters/.powershell-psscriptanalyzer.psd1 +++ b/.github/linters/.powershell-psscriptanalyzer.psd1 @@ -1,18 +1,56 @@ -#Documentation: https://github.com/PowerShell/PSScriptAnalyzer/blob/master/docs/Cmdlets/Invoke-ScriptAnalyzer.md#-settings -@{ - #CustomRulePath='path\to\CustomRuleModule.psm1' - #RecurseCustomRulePath='path\of\customrules' - #Severity = @( - # 'Error' - # 'Warning' - #) - #IncludeDefaultRules=${true} +@{ + Rules = @{ + PSAlignAssignmentStatement = @{ + Enable = $true + CheckHashtable = $true + } + PSAvoidLongLines = @{ + Enable = $true + MaximumLineLength = 150 + } + PSAvoidSemicolonsAsLineTerminators = @{ + Enable = $true + } + PSPlaceCloseBrace = @{ + Enable = $true + NewLineAfter = $false + IgnoreOneLineBlock = $true + NoEmptyLineBefore = $false + } + PSPlaceOpenBrace = @{ + Enable = $true + OnSameLine = $true + NewLineAfter = $true + IgnoreOneLineBlock = $true + } + PSProvideCommentHelp = @{ + Enable = $true + ExportedOnly = $false + BlockComment = $true + VSCodeSnippetCorrection = $false + Placement = 'begin' + } + PSUseConsistentIndentation = @{ + Enable = $true + IndentationSize = 4 + PipelineIndentation = 'IncreaseIndentationForFirstPipeline' + Kind = 'space' + } + PSUseConsistentWhitespace = @{ + Enable = $true + CheckInnerBrace = $true + CheckOpenBrace = $true + CheckOpenParen = $true + CheckOperator = $true + CheckPipe = $true + CheckPipeForRedundantWhitespace = $true + CheckSeparator = $true + CheckParameter = $true + IgnoreAssignmentOperatorInsideHashTable = $true + } + } ExcludeRules = @( - 'PSMissingModuleManifestField' - 'PSAvoidUsingWriteHost' + 'PSMissingModuleManifestField', # This rule is not applicable until the module is built. + 'PSUseToExportFieldsInManifest' ) - #IncludeRules = @( - # 'PSAvoidUsingWriteHost', - # 'MyCustomRuleName' - #) } diff --git a/.github/linters/.textlintrc b/.github/linters/.textlintrc new file mode 100644 index 0000000..db48de8 --- /dev/null +++ b/.github/linters/.textlintrc @@ -0,0 +1,513 @@ +{ + "filters": { + "comments": true + }, + "rules": { + "terminology": { + "defaultTerms": false, + "terms": [ + "Airbnb", + "Android", + "AppleScript", + "AppVeyor", + "AVA", + "BrowserStack", + "Browsersync", + "Codecov", + "CodePen", + "CodeSandbox", + "DefinitelyTyped", + "EditorConfig", + "ESLint", + "GitHub", + "GraphQL", + "GraphiQL", + "iOS", + "JavaScript", + "JetBrains", + "jQuery", + "LinkedIn", + "Lodash", + "MacBook", + "Markdown", + "OpenType", + "PayPal", + "PhpStorm", + "PowerShell", + "PlayStation", + "RubyMine", + "Sass", + "SemVer", + "TypeScript", + "UglifyJS", + "Wasm", + "WebAssembly", + "WebStorm", + "WordPress", + "YouTube", + [ + "Common[ .]js", + "CommonJS" + ], + [ + "JSDocs?", + "JSDoc" + ], + [ + "Node[ .]js", + "Node.js" + ], + [ + "React[ .]js", + "React" + ], + [ + "SauceLabs", + "Sauce Labs" + ], + [ + "StackOverflow", + "Stack Overflow" + ], + [ + "styled ?components", + "styled-components" + ], + [ + "HTTP[ /]2(?:\\.0)?", + "HTTP/2" + ], + [ + "OS X", + "macOS" + ], + [ + "Mac ?OS", + "macOS" + ], + [ + "a npm", + "an npm" + ], + "ECMAScript", + [ + "ES2015", + "ES6" + ], + [ + "ES7", + "ES2016" + ], + "3D", + [ + "3-D", + "3D" + ], + "Ajax", + "API", + "APIs", + "API's", + [ + "(? [CmdletBinding()] + #Requires -Modules @{ ModuleName = 'GitHub'; ModuleVersion = '0.13.2' } + #Requires -Modules @{ ModuleName = 'Utilities'; ModuleVersion = '0.3.0' } [Diagnostics.CodeAnalysis.SuppressMessageAttribute( 'PSReviewUnusedParameter', '', Scope = 'Function', Justification = 'LogGroup - Scoping affects the variables line of sight.' )] + [Diagnostics.CodeAnalysis.SuppressMessageAttribute( + 'PSAvoidUsingWriteHost', '', Scope = 'Function', + Justification = 'Want to just write to the console, not the pipeline.' + )] param( # Name of the module. [Parameter(Mandatory)] diff --git a/scripts/helpers/Build/Build-PSModuleBase.ps1 b/scripts/helpers/Build/Build-PSModuleBase.ps1 index d8c49a8..ffb664d 100644 --- a/scripts/helpers/Build/Build-PSModuleBase.ps1 +++ b/scripts/helpers/Build/Build-PSModuleBase.ps1 @@ -1,22 +1,25 @@ -#Requires -Modules @{ ModuleName = 'GitHub'; ModuleVersion = '0.13.2' } - -function Build-PSModuleBase { +function Build-PSModuleBase { <# - .SYNOPSIS - Compiles the base module files. + .SYNOPSIS + Compiles the base module files. - .DESCRIPTION - This function will compile the base module files. - It will copy the source files to the output folder and remove the files that are not needed. + .DESCRIPTION + This function will compile the base module files. + It will copy the source files to the output folder and remove the files that are not needed. - .EXAMPLE - Build-PSModuleBase -SourceFolderPath 'C:\MyModule\src\MyModule' -OutputFolderPath 'C:\MyModule\build\MyModule' + .EXAMPLE + Build-PSModuleBase -SourceFolderPath 'C:\MyModule\src\MyModule' -OutputFolderPath 'C:\MyModule\build\MyModule' #> [CmdletBinding()] + #Requires -Modules @{ ModuleName = 'GitHub'; ModuleVersion = '0.13.2' } [Diagnostics.CodeAnalysis.SuppressMessageAttribute( 'PSReviewUnusedParameter', '', Scope = 'Function', Justification = 'LogGroup - Scoping affects the variables line of sight.' )] + [Diagnostics.CodeAnalysis.SuppressMessageAttribute( + 'PSAvoidUsingWriteHost', '', Scope = 'Function', + Justification = 'Want to just write to the console, not the pipeline.' + )] param( # Name of the module. [Parameter(Mandatory)] diff --git a/scripts/helpers/Build/Build-PSModuleManifest.ps1 b/scripts/helpers/Build/Build-PSModuleManifest.ps1 index 002232a..2a611f0 100644 --- a/scripts/helpers/Build/Build-PSModuleManifest.ps1 +++ b/scripts/helpers/Build/Build-PSModuleManifest.ps1 @@ -1,19 +1,18 @@ -#Requires -Modules @{ ModuleName = 'GitHub'; ModuleVersion = '0.13.2' } -#Requires -Modules @{ ModuleName = 'Utilities'; ModuleVersion = '0.3.0' } - -function Build-PSModuleManifest { +function Build-PSModuleManifest { <# - .SYNOPSIS - Compiles the module manifest. + .SYNOPSIS + Compiles the module manifest. - .DESCRIPTION - This function will compile the module manifest. - It will generate the module manifest file and copy it to the output folder. + .DESCRIPTION + This function will compile the module manifest. + It will generate the module manifest file and copy it to the output folder. - .EXAMPLE - Build-PSModuleManifest -SourceFolderPath 'C:\MyModule\src\MyModule' -OutputFolderPath 'C:\MyModule\build\MyModule' + .EXAMPLE + Build-PSModuleManifest -SourceFolderPath 'C:\MyModule\src\MyModule' -OutputFolderPath 'C:\MyModule\build\MyModule' #> [CmdletBinding()] + #Requires -Modules @{ ModuleName = 'GitHub'; ModuleVersion = '0.13.2' } + #Requires -Modules @{ ModuleName = 'Utilities'; ModuleVersion = '0.3.0' } [Diagnostics.CodeAnalysis.SuppressMessageAttribute( 'PSAvoidLongLines', '', Scope = 'Function', Justification = 'Easier to read the multi ternery operators in a single line.' @@ -22,6 +21,10 @@ function Build-PSModuleManifest { 'PSReviewUnusedParameter', '', Scope = 'Function', Justification = 'LogGroup - Scoping affects the variables line of sight.' )] + [Diagnostics.CodeAnalysis.SuppressMessageAttribute( + 'PSAvoidUsingWriteHost', '', Scope = 'Function', + Justification = 'Want to just write to the console, not the pipeline.' + )] param( # Name of the module. [Parameter(Mandatory)] diff --git a/scripts/helpers/Build/Get-PSModuleAliasesToExport.ps1 b/scripts/helpers/Build/Get-PSModuleAliasesToExport.ps1 index 036ae80..5c8a990 100644 --- a/scripts/helpers/Build/Get-PSModuleAliasesToExport.ps1 +++ b/scripts/helpers/Build/Get-PSModuleAliasesToExport.ps1 @@ -1,6 +1,4 @@ -#Requires -Modules @{ ModuleName = 'Utilities'; ModuleVersion = '0.3.0' } - -function Get-PSModuleAliasesToExport { +function Get-PSModuleAliasesToExport { <# .SYNOPSIS Gets the aliases to export from the module manifest. @@ -12,6 +10,11 @@ function Get-PSModuleAliasesToExport { Get-PSModuleAliasesToExport -SourceFolderPath 'C:\MyModule\src\MyModule' #> [CmdletBinding()] + #Requires -Modules @{ ModuleName = 'Utilities'; ModuleVersion = '0.3.0' } + [Diagnostics.CodeAnalysis.SuppressMessageAttribute( + 'PSAvoidUsingWriteHost', '', Scope = 'Function', + Justification = 'Want to just write to the console, not the pipeline.' + )] param( # Path to the folder where the module source code is located. [Parameter(Mandatory)] diff --git a/scripts/helpers/Build/Get-PSModuleCmdletsToExport.ps1 b/scripts/helpers/Build/Get-PSModuleCmdletsToExport.ps1 index 850c10c..2e07f8c 100644 --- a/scripts/helpers/Build/Get-PSModuleCmdletsToExport.ps1 +++ b/scripts/helpers/Build/Get-PSModuleCmdletsToExport.ps1 @@ -1,6 +1,4 @@ -#Requires -Modules @{ ModuleName = 'Utilities'; ModuleVersion = '0.3.0' } - -function Get-PSModuleCmdletsToExport { +function Get-PSModuleCmdletsToExport { <# .SYNOPSIS Gets the cmdlets to export from the module manifest. @@ -12,6 +10,11 @@ function Get-PSModuleCmdletsToExport { Get-PSModuleCmdletsToExport -SourceFolderPath 'C:\MyModule\src\MyModule' #> [CmdletBinding()] + #Requires -Modules @{ ModuleName = 'Utilities'; ModuleVersion = '0.3.0' } + [Diagnostics.CodeAnalysis.SuppressMessageAttribute( + 'PSAvoidUsingWriteHost', '', Scope = 'Function', + Justification = 'Want to just write to the console, not the pipeline.' + )] param( # Path to the folder where the module source code is located. [Parameter(Mandatory)] diff --git a/scripts/helpers/Build/Get-PSModuleFunctionsToExport.ps1 b/scripts/helpers/Build/Get-PSModuleFunctionsToExport.ps1 index 99f3496..03671c8 100644 --- a/scripts/helpers/Build/Get-PSModuleFunctionsToExport.ps1 +++ b/scripts/helpers/Build/Get-PSModuleFunctionsToExport.ps1 @@ -10,6 +10,10 @@ Get-PSModuleFunctionsToExport -SourceFolderPath 'C:\MyModule\src\MyModule' #> [CmdletBinding()] + [Diagnostics.CodeAnalysis.SuppressMessageAttribute( + 'PSAvoidUsingWriteHost', '', Scope = 'Function', + Justification = 'Want to just write to the console, not the pipeline.' + )] [OutputType([array])] param( # Path to the folder where the module source code is located. diff --git a/scripts/helpers/Build/Get-PSModuleVariablesToExport.ps1 b/scripts/helpers/Build/Get-PSModuleVariablesToExport.ps1 index c842a30..e2810ba 100644 --- a/scripts/helpers/Build/Get-PSModuleVariablesToExport.ps1 +++ b/scripts/helpers/Build/Get-PSModuleVariablesToExport.ps1 @@ -10,6 +10,10 @@ Get-PSModuleVariablesToExport -SourceFolderPath 'C:\MyModule\src\MyModule' #> [OutputType([Collections.Generic.List[string]])] + [Diagnostics.CodeAnalysis.SuppressMessageAttribute( + 'PSAvoidUsingWriteHost', '', Scope = 'Function', + Justification = 'Want to just write to the console, not the pipeline.' + )] [CmdletBinding()] param( # Path to the folder where the module source code is located. diff --git a/scripts/helpers/Build/Import-PSModule.ps1 b/scripts/helpers/Build/Import-PSModule.ps1 index 2797069..79fa949 100644 --- a/scripts/helpers/Build/Import-PSModule.ps1 +++ b/scripts/helpers/Build/Import-PSModule.ps1 @@ -1,6 +1,4 @@ -#Requires -Modules @{ ModuleName = 'Utilities'; ModuleVersion = '0.3.0' } - -function Import-PSModule { +function Import-PSModule { <# .SYNOPSIS Imports a build PS module. @@ -14,6 +12,11 @@ function Import-PSModule { Imports a module located at $ModuleFolderPath with the name $ModuleName. #> [CmdletBinding()] + [Diagnostics.CodeAnalysis.SuppressMessageAttribute( + 'PSAvoidUsingWriteHost', '', Scope = 'Function', + Justification = 'Want to just write to the console, not the pipeline.' + )] + #Requires -Modules @{ ModuleName = 'Utilities'; ModuleVersion = '0.3.0' } param( # Path to the folder where the module source code is located. [Parameter(Mandatory)] diff --git a/scripts/helpers/Build/PSScriptAnalyzer.Tests.psd1 b/scripts/helpers/Build/PSScriptAnalyzer.Tests.psd1 index bd8fb92..9f7bc65 100644 --- a/scripts/helpers/Build/PSScriptAnalyzer.Tests.psd1 +++ b/scripts/helpers/Build/PSScriptAnalyzer.Tests.psd1 @@ -50,7 +50,6 @@ } } ExcludeRules = @( - 'PSAvoidUsingCmdletAliases', 'PSUseToExportFieldsInManifest' ) } diff --git a/scripts/helpers/Build/Resolve-PSModuleDependency.ps1 b/scripts/helpers/Build/Resolve-PSModuleDependency.ps1 index 4924d3e..accf607 100644 --- a/scripts/helpers/Build/Resolve-PSModuleDependency.ps1 +++ b/scripts/helpers/Build/Resolve-PSModuleDependency.ps1 @@ -1,25 +1,28 @@ -#Requires -Modules @{ ModuleName = 'Retry'; ModuleVersion = '0.1.3' } - -function Resolve-PSModuleDependency { +function Resolve-PSModuleDependency { <# - .SYNOPSIS - Resolve dependencies for a module based on the manifest file. + .SYNOPSIS + Resolve dependencies for a module based on the manifest file. - .DESCRIPTION - Resolve dependencies for a module based on the manifest file, following PSModuleInfo structure + .DESCRIPTION + Resolve dependencies for a module based on the manifest file, following PSModuleInfo structure - .EXAMPLE - Resolve-PSModuleDependency -Path 'C:\MyModule\MyModule.psd1' + .EXAMPLE + Resolve-PSModuleDependency -Path 'C:\MyModule\MyModule.psd1' - Installs all modules defined in the manifest file, following PSModuleInfo structure. + Installs all modules defined in the manifest file, following PSModuleInfo structure. - .NOTES - Should later be adapted to support both pre-reqs, and dependencies. - Should later be adapted to take 4 parameters sets: specific version ("requiredVersion" | "GUID"), latest version ModuleVersion, - and latest version within a range MinimumVersion - MaximumVersion. + .NOTES + Should later be adapted to support both pre-reqs, and dependencies. + Should later be adapted to take 4 parameters sets: specific version ("requiredVersion" | "GUID"), latest version ModuleVersion, + and latest version within a range MinimumVersion - MaximumVersion. #> + [Diagnostics.CodeAnalysis.SuppressMessageAttribute( + 'PSAvoidUsingWriteHost', '', Scope = 'Function', + Justification = 'Want to just write to the console, not the pipeline.' + )] [Alias('Resolve-PSModuleDependencies')] [CmdletBinding()] + #Requires -Modules @{ ModuleName = 'Retry'; ModuleVersion = '0.1.3' } param( # The path to the manifest file. [Parameter(Mandatory)] diff --git a/scripts/helpers/Build/Update-PSModuleManifestAliasesToExport.ps1 b/scripts/helpers/Build/Update-PSModuleManifestAliasesToExport.ps1 index eccabdb..47d64e4 100644 --- a/scripts/helpers/Build/Update-PSModuleManifestAliasesToExport.ps1 +++ b/scripts/helpers/Build/Update-PSModuleManifestAliasesToExport.ps1 @@ -1,10 +1,7 @@ -#Requires -Modules @{ ModuleName = 'GitHub'; ModuleVersion = '0.13.2' } -#Requires -Modules @{ ModuleName = 'Utilities'; ModuleVersion = '0.3.0' } - -function Update-PSModuleManifestAliasesToExport { +function Update-PSModuleManifestAliasesToExport { <# - .SYNOPSIS - Updates the aliases to export in the module manifest. + .SYNOPSIS + Updates the aliases to export in the module manifest. #> [Diagnostics.CodeAnalysis.SuppressMessageAttribute( 'PSUseShouldProcessForStateChangingFunctions', '', Scope = 'Function', @@ -14,6 +11,12 @@ function Update-PSModuleManifestAliasesToExport { 'PSReviewUnusedParameter', '', Scope = 'Function', Justification = 'LogGroup - Scoping affects the variables line of sight.' )] + [Diagnostics.CodeAnalysis.SuppressMessageAttribute( + 'PSAvoidUsingWriteHost', '', Scope = 'Function', + Justification = 'Want to just write to the console, not the pipeline.' + )] + #Requires -Modules @{ ModuleName = 'GitHub'; ModuleVersion = '0.13.2' } + #Requires -Modules @{ ModuleName = 'Utilities'; ModuleVersion = '0.3.0' } [CmdletBinding()] param( # Name of the module. diff --git a/scripts/main.ps1 b/scripts/main.ps1 index bb80c67..d831ebe 100644 --- a/scripts/main.ps1 +++ b/scripts/main.ps1 @@ -1,8 +1,12 @@ -#Requires -Modules Utilities - +[Diagnostics.CodeAnalysis.SuppressMessageAttribute( + 'PSAvoidUsingWriteHost', '', + Justification = 'Want to just write to the console, not the pipeline.' +)] [CmdletBinding()] param() +#Requires -Modules Utilities + $path = (Join-Path -Path $PSScriptRoot -ChildPath 'helpers') | Get-Item | Resolve-Path -Relative LogGroup "Loading helper scripts from [$path]" { Get-ChildItem -Path $path -Filter '*.ps1' -Recurse | Resolve-Path -Relative | ForEach-Object { diff --git a/tests/tools/1-build.ps1 b/tests/tools/1-build.ps1 index f3a17f2..e762395 100644 --- a/tests/tools/1-build.ps1 +++ b/tests/tools/1-build.ps1 @@ -1 +1 @@ -Write-Host "1 - Build script executed." +"1 - Build script executed." diff --git a/tests/tools/2-build.ps1 b/tests/tools/2-build.ps1 index d839b51..d2575a0 100644 --- a/tests/tools/2-build.ps1 +++ b/tests/tools/2-build.ps1 @@ -1 +1 @@ -Write-Host "2 - Build script executed." +"2 - Build script executed."