From e771804f48abdaf415dbcbe22845f425046dca13 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sat, 11 Oct 2025 17:37:49 +0200 Subject: [PATCH 1/5] =?UTF-8?q?=F0=9F=9A=80[Feature]:=20Upgrade=20Invoke-S?= =?UTF-8?q?criptAnalyzer=20to=20v4=20in=20Lint=20and=20Test=20workflows?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/Lint-SourceCode.yml | 3 +-- .github/workflows/Test-Module.yml | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/Lint-SourceCode.yml b/.github/workflows/Lint-SourceCode.yml index 21ef6db1..9f9c7eb4 100644 --- a/.github/workflows/Lint-SourceCode.yml +++ b/.github/workflows/Lint-SourceCode.yml @@ -56,14 +56,13 @@ jobs: fetch-depth: 0 - name: Lint-SourceCode - uses: PSModule/Invoke-ScriptAnalyzer@v3 + uses: PSModule/Invoke-ScriptAnalyzer@v4 with: Debug: ${{ inputs.Debug }} Prerelease: ${{ inputs.Prerelease }} Verbose: ${{ inputs.Verbose }} Version: ${{ inputs.Version }} Path: src - Settings: SourceCode WorkingDirectory: ${{ inputs.WorkingDirectory }} TestResult_Enabled: true TestResult_TestSuiteName: PSModuleLint-SourceCode-${{ runner.os }} diff --git a/.github/workflows/Test-Module.yml b/.github/workflows/Test-Module.yml index 01b9fa24..1d96de31 100644 --- a/.github/workflows/Test-Module.yml +++ b/.github/workflows/Test-Module.yml @@ -114,7 +114,7 @@ jobs: path: ${{ inputs.WorkingDirectory }}/outputs/module - name: Lint-Module - uses: PSModule/Invoke-ScriptAnalyzer@v3 + uses: PSModule/Invoke-ScriptAnalyzer@v4 with: Path: outputs/module Debug: ${{ inputs.Debug }} @@ -122,6 +122,5 @@ jobs: Verbose: ${{ inputs.Verbose }} Version: ${{ inputs.Version }} WorkingDirectory: ${{ inputs.WorkingDirectory }} - Settings: Module TestResult_Enabled: true TestResult_TestSuiteName: PSModuleLint-Module-${{ runner.os }} From f0470e05df8cf02af675fce8025e06c35a8f4f9e Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sat, 11 Oct 2025 21:15:26 +0200 Subject: [PATCH 2/5] =?UTF-8?q?=F0=9F=9A=80[Feature]:=20Add=20PowerShell?= =?UTF-8?q?=20ScriptAnalyzer=20configuration=20file=20with=20linting=20rul?= =?UTF-8?q?es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../linters/.powershell-psscriptanalyzer.psd1 | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 tests/srcWithManifestTestRepo/.github/linters/.powershell-psscriptanalyzer.psd1 diff --git a/tests/srcWithManifestTestRepo/.github/linters/.powershell-psscriptanalyzer.psd1 b/tests/srcWithManifestTestRepo/.github/linters/.powershell-psscriptanalyzer.psd1 new file mode 100644 index 00000000..09cc3d0c --- /dev/null +++ b/tests/srcWithManifestTestRepo/.github/linters/.powershell-psscriptanalyzer.psd1 @@ -0,0 +1,56 @@ +@{ + 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', # This rule is not applicable until the module is built. + 'PSUseToExportFieldsInManifest' + ) +} From 2832e57ed60e5ea202e368610ddc98fdf1d61bb0 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sat, 11 Oct 2025 21:30:47 +0200 Subject: [PATCH 3/5] =?UTF-8?q?=F0=9F=9A=80[Feature]:=20Update=20Invoke-Sc?= =?UTF-8?q?riptAnalyzer=20usage=20to=20debugPath=20in=20Lint=20workflows?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/Lint-SourceCode.yml | 2 +- .github/workflows/Test-Module.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Lint-SourceCode.yml b/.github/workflows/Lint-SourceCode.yml index 9f9c7eb4..c356c14d 100644 --- a/.github/workflows/Lint-SourceCode.yml +++ b/.github/workflows/Lint-SourceCode.yml @@ -56,7 +56,7 @@ jobs: fetch-depth: 0 - name: Lint-SourceCode - uses: PSModule/Invoke-ScriptAnalyzer@v4 + uses: PSModule/Invoke-ScriptAnalyzer@debugPath #v4 with: Debug: ${{ inputs.Debug }} Prerelease: ${{ inputs.Prerelease }} diff --git a/.github/workflows/Test-Module.yml b/.github/workflows/Test-Module.yml index 1d96de31..0cb231a9 100644 --- a/.github/workflows/Test-Module.yml +++ b/.github/workflows/Test-Module.yml @@ -114,7 +114,7 @@ jobs: path: ${{ inputs.WorkingDirectory }}/outputs/module - name: Lint-Module - uses: PSModule/Invoke-ScriptAnalyzer@v4 + uses: PSModule/Invoke-ScriptAnalyzer@debugPath #v4 with: Path: outputs/module Debug: ${{ inputs.Debug }} From 7ad44ad7ec9e0cabc1ae55373d6383239a02c6b4 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sat, 11 Oct 2025 22:36:14 +0200 Subject: [PATCH 4/5] =?UTF-8?q?=F0=9F=9A=80[Feature]:=20Remove=20redundant?= =?UTF-8?q?=20Name=20parameter=20from=20Workflow-Test-WithManifest.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/Workflow-Test-WithManifest.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/Workflow-Test-WithManifest.yml b/.github/workflows/Workflow-Test-WithManifest.yml index 8caaabc1..85409571 100644 --- a/.github/workflows/Workflow-Test-WithManifest.yml +++ b/.github/workflows/Workflow-Test-WithManifest.yml @@ -25,5 +25,4 @@ jobs: secrets: inherit with: WorkingDirectory: tests/srcWithManifestTestRepo - Name: PSModuleTest2 SettingsPath: .github/PSModule.yml From 03aa47f1a6773e670991b3bbad95d2bd57d2d85c Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sat, 11 Oct 2025 23:18:03 +0200 Subject: [PATCH 5/5] =?UTF-8?q?=F0=9F=9A=80[Feature]:=20Update=20Invoke-Sc?= =?UTF-8?q?riptAnalyzer=20usage=20to=20v4=20in=20Lint=20and=20Test=20workf?= =?UTF-8?q?lows?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/Lint-SourceCode.yml | 3 +-- .github/workflows/Test-Module.yml | 8 ++++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/Lint-SourceCode.yml b/.github/workflows/Lint-SourceCode.yml index c356c14d..627dfc08 100644 --- a/.github/workflows/Lint-SourceCode.yml +++ b/.github/workflows/Lint-SourceCode.yml @@ -53,10 +53,9 @@ jobs: uses: actions/checkout@v5 with: persist-credentials: false - fetch-depth: 0 - name: Lint-SourceCode - uses: PSModule/Invoke-ScriptAnalyzer@debugPath #v4 + uses: PSModule/Invoke-ScriptAnalyzer@v4 with: Debug: ${{ inputs.Debug }} Prerelease: ${{ inputs.Prerelease }} diff --git a/.github/workflows/Test-Module.yml b/.github/workflows/Test-Module.yml index 0cb231a9..e6d757d7 100644 --- a/.github/workflows/Test-Module.yml +++ b/.github/workflows/Test-Module.yml @@ -84,7 +84,6 @@ jobs: uses: actions/checkout@v5 with: persist-credentials: false - fetch-depth: 0 - name: Download module artifact uses: actions/download-artifact@v5 @@ -107,6 +106,11 @@ jobs: name: Lint-Module (${{ inputs.RunsOn }}) runs-on: ${{ inputs.RunsOn }} steps: + - name: Checkout repository + uses: actions/checkout@v5 + with: + persist-credentials: false + - name: Download module artifact uses: actions/download-artifact@v5 with: @@ -114,7 +118,7 @@ jobs: path: ${{ inputs.WorkingDirectory }}/outputs/module - name: Lint-Module - uses: PSModule/Invoke-ScriptAnalyzer@debugPath #v4 + uses: PSModule/Invoke-ScriptAnalyzer@v4 with: Path: outputs/module Debug: ${{ inputs.Debug }}