You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The CI pipeline fails on every platform (Linux, macOS, Windows) for both Lint-SourceCode and Lint-Module jobs due to PSAvoidLongLines violations detected by PSScriptAnalyzer. The default maximum line length enforced by the rule is 120 characters.
Request
What happens
Running the Process-PSModule workflow on PR #18 produces lint failures across all three platforms:
❌ Some [1] tests failed.
[-] Avoid long lines (PSAvoidLongLines) 63ms (61ms|2ms)
The same failure is reproduced on the built module artifact during Lint-Module, confirming the violations originate in source rather than being introduced by the build step. The Get-TestResults job then aggregates these failures and exits with a non-zero code, blocking the rest of the pipeline.
Observe violations reported in New-Jwt.ps1, Test-Jwt.ps1, and ConvertTo-Base64UrlString.ps1
What is expected
All source files pass PSAvoidLongLines with no violations so that the Lint-SourceCode and Lint-Module CI jobs succeed and the pipeline can continue through to publish.
Platforms affected: Linux, macOS, Windows (all three matrix legs)
Regression
This has been present since the init branch was first pushed. Not a regression from a previously passing state.
Workaround
None. The CI gate cannot be bypassed without skipping the linter.
Acceptance criteria
All files under src/functions/public/ pass PSAvoidLongLines with no violations
No functional behavior of New-Jwt, Test-Jwt, or ConvertTo-Base64UrlString changes as a result of the reformatting
Lint-SourceCode and Lint-Module CI jobs pass on all three platforms
Technical decisions
Affected files and line counts: The violations are isolated to three files — New-Jwt.ps1 (7 lines), Test-Jwt.ps1 (6 lines), and ConvertTo-Base64UrlString.ps1 (2 lines — one in the .NOTES comment block, one in the throw statement). All exceed 120 characters.
Fix strategy: Each long line falls into one of three categories:
Long throw message strings — extract the message into a $message variable on a preceding line, then throw using that variable.
Long inline conditionals (if ($Secret -is [byte[]]) { $Secret } else { ... }) — split across multiple lines using PowerShell's implicit line continuation inside grouping expressions.
Long .NOTES comment text — wrap the sentence at a natural word boundary within 120 characters.
Scope: Pure formatting change. No logic, parameter names, error types, or test assertions are altered.
Implementation plan
Source fixes
In New-Jwt.ps1, extract long throw message strings into $message variables (lines 80, 90, 101, 106, 128, 144)
In New-Jwt.ps1, split the long $hmacsha256.Key = if (...) {...} else {...} assignment across multiple lines (line 132)
In Test-Jwt.ps1, extract long throw message strings into $message variables (lines 78, 88, 103, 121, 154)
In Test-Jwt.ps1, split the long $hmacsha256.Key = if (...) {...} else {...} assignment across multiple lines (line 125)
In ConvertTo-Base64UrlString.ps1, wrap the .NOTES comment line at a word boundary under 120 characters (line 24)
In ConvertTo-Base64UrlString.ps1, extract the long throw message string into a $message variable (line 51)
Validation
Confirm Invoke-ScriptAnalyzer -Path ./src/functions/public/ -IncludeRule PSAvoidLongLines returns no results
Confirm all existing Pester tests in tests/Jwt.Tests.ps1 still pass after reformatting
The CI pipeline fails on every platform (Linux, macOS, Windows) for both
Lint-SourceCodeandLint-Modulejobs due toPSAvoidLongLinesviolations detected by PSScriptAnalyzer. The default maximum line length enforced by the rule is 120 characters.Request
What happens
Running the Process-PSModule workflow on PR #18 produces lint failures across all three platforms:
The same failure is reproduced on the built module artifact during
Lint-Module, confirming the violations originate in source rather than being introduced by the build step. TheGet-TestResultsjob then aggregates these failures and exits with a non-zero code, blocking the rest of the pipeline.Reproduction steps
initbranch of this repositorysrc/functions/public/:New-Jwt.ps1,Test-Jwt.ps1, andConvertTo-Base64UrlString.ps1What is expected
All source files pass
PSAvoidLongLineswith no violations so that theLint-SourceCodeandLint-ModuleCI jobs succeed and the pipeline can continue through to publish.Environment
initbranch, Actions run 25694258038)PSAvoidLongLines(max 120 characters)Regression
This has been present since the
initbranch was first pushed. Not a regression from a previously passing state.Workaround
None. The CI gate cannot be bypassed without skipping the linter.
Acceptance criteria
src/functions/public/passPSAvoidLongLineswith no violationsNew-Jwt,Test-Jwt, orConvertTo-Base64UrlStringchanges as a result of the reformattingLint-SourceCodeandLint-ModuleCI jobs pass on all three platformsTechnical decisions
Affected files and line counts: The violations are isolated to three files —
New-Jwt.ps1(7 lines),Test-Jwt.ps1(6 lines), andConvertTo-Base64UrlString.ps1(2 lines — one in the.NOTEScomment block, one in thethrowstatement). All exceed 120 characters.Fix strategy: Each long line falls into one of three categories:
throwmessage strings — extract the message into a$messagevariable on a preceding line, thenthrowusing that variable.if ($Secret -is [byte[]]) { $Secret } else { ... }) — split across multiple lines using PowerShell's implicit line continuation inside grouping expressions..NOTEScomment text — wrap the sentence at a natural word boundary within 120 characters.Scope: Pure formatting change. No logic, parameter names, error types, or test assertions are altered.
Implementation plan
Source fixes
New-Jwt.ps1, extract longthrowmessage strings into$messagevariables (lines 80, 90, 101, 106, 128, 144)New-Jwt.ps1, split the long$hmacsha256.Key = if (...) {...} else {...}assignment across multiple lines (line 132)Test-Jwt.ps1, extract longthrowmessage strings into$messagevariables (lines 78, 88, 103, 121, 154)Test-Jwt.ps1, split the long$hmacsha256.Key = if (...) {...} else {...}assignment across multiple lines (line 125)ConvertTo-Base64UrlString.ps1, wrap the.NOTEScomment line at a word boundary under 120 characters (line 24)ConvertTo-Base64UrlString.ps1, extract the longthrowmessage string into a$messagevariable (line 51)Validation
Invoke-ScriptAnalyzer -Path ./src/functions/public/ -IncludeRule PSAvoidLongLinesreturns no resultstests/Jwt.Tests.ps1still pass after reformatting