🩹 [Patch]: Linting passes on all platforms#25
Open
Marius Storhaug (MariusStorhaug) wants to merge 1 commit into
Open
🩹 [Patch]: Linting passes on all platforms#25Marius Storhaug (MariusStorhaug) wants to merge 1 commit into
Marius Storhaug (MariusStorhaug) wants to merge 1 commit into
Conversation
Super-linter summary
All files and directories linted successfully For more information, see the GitHub Actions workflow run Powered by Super-linter |
Copilot started reviewing on behalf of
Marius Storhaug (MariusStorhaug)
May 11, 2026 23:25
View session
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.
| throw [System.ArgumentException]::new("ConvertTo-Base64UrlString requires string or byte array input, received $($InputObject.GetType())") | ||
| $type = $InputObject.GetType() | ||
| $message = "ConvertTo-Base64UrlString requires string or byte array input, received $type" | ||
| throw [System.ArgumentException]::new($message) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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).