🩹 [Patch]: Linting passes on all platforms#25
Conversation
Super-linter summary
All files and directories linted successfully For more information, see the GitHub Actions workflow run Powered by Super-linter |
There was a problem hiding this comment.
Pull request overview
This patch addresses CI lint failures caused by PSScriptAnalyzer’s PSAvoidLongLines rule, ensuring linting succeeds across Linux/macOS/Windows by shortening previously overlong lines without changing functional behavior.
Changes:
- Refactored long
throwmessages inNew-JwtandTest-Jwtinto intermediate$messagevariables. - Reformatted the inline HS256 key assignment (
$hmacsha256.Key = if (...) { ... } else { ... }) into a multi-lineif/elseexpression. - Wrapped a long comment-based help
.NOTESline and shortened athrowstatement inConvertTo-Base64UrlString.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/functions/public/Test-Jwt.ps1 | Breaks up long throw-message lines and reformats HS256 key assignment to satisfy PSAvoidLongLines. |
| src/functions/public/New-Jwt.ps1 | Breaks up long throw-message lines and reformats HS256 key assignment to satisfy PSAvoidLongLines. |
| src/functions/public/ConvertTo-Base64UrlString.ps1 | Wraps long help text and refactors an ArgumentException message to avoid long lines. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Super-linter summary
All files and directories linted successfully For more information, see the GitHub Actions workflow run Powered by Super-linter |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Super-linter summary
All files and directories linted successfully For more information, see the GitHub Actions workflow run Powered by Super-linter |
|
✅ New release: PowerShell Gallery - Jwt 1.9.5 |
|
✅ New release: GitHub - Jwt v1.9.5 |
The
Lint-SourceCodeandLint-ModuleCI jobs now pass on Linux, macOS, and Windows. AllPSAvoidLongLinesviolations that blocked the pipeline after PR #18 was merged have been resolved by extracting long error message strings into local variables and splitting long inline conditionals across multiple lines.Fixed: Linting no longer fails on any platform
PSScriptAnalyzerreported aPSAvoidLongLinesviolation (line length > 120 characters) in three source files, causing every platform leg of bothLint-SourceCodeandLint-Moduleto exit with code 1 and preventingGet-TestResultsfrom completing successfully.The affected lines were all
throwstatements with long interpolated error messages and one long inlineif/elseexpression used to set an HMAC key. Each has been reformatted — long messages extracted into a$messagevariable, and the inline conditional split across multiple lines. No error types, parameter names, function signatures, or observable behaviors changed.All 31 Pester tests pass locally after the reformatting.
Technical Details
New-Jwt.ps1— 7 violations fixed:throwmessages on lines 80, 90, 101, 106, 128, 144 extracted to$messagevariables;$hmacsha256.Key = if (...) {...} else {...}on line 132 split across multiple lines.Test-Jwt.ps1— 6 violations fixed: same patterns asNew-Jwt.ps1(lines 78, 88, 103, 121, 125, 154).ConvertTo-Base64UrlString.ps1— 2 violations fixed:.NOTEScomment wrapped at a word boundary (line 24);throwmessage extracted via an intermediate$typevariable to stay within 120 chars (line 51).Invoke-ScriptAnalyzerreturns noPSAvoidLongLinesresults, and all 31 Pester tests pass.